This file is indexed.

/usr/lib/clisp-2.49/dbus/dbus.lisp is in clisp-module-dbus 1:2.49-8.1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

   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
;;; D-Bus interface <http://www.freedesktop.org/Software/dbus>
;;;
;;; Copyright (C) 2008-2009 by Sam Steingold
;;; This is Free Software, covered by the GNU GPL (v2+)
;;; See http://www.gnu.org/copyleft/gpl.html

;; synced with dbus-1.2.14
;; to update to a new release:
;;    git clone git://anongit.freedesktop.org/git/dbus/dbus ; cd dbus
;; or cd dbus; git pull
;; git diff dbus-1.2.14 dbus-<latest> dbus/*.h

(defpackage "DBUS"
  (:modern t)
  (:use "CL" "FFI")
  (:shadowing-import-from "EXPORTING"
    #:defconstant #:defvar #:defun #:defmacro #:define-symbol-macro
    #:def-c-const #:def-c-type #:def-c-enum #:def-c-struct #:def-c-var
    #:def-call-out))

(in-package "DBUS")

(setf (documentation (find-package "DBUS") 'sys::impnotes) "dbus")

;;; foreign function definitions
(default-foreign-language :stdc)
(eval-when (compile) (setq *foreign-guard* t))

(c-lines "#include \"config.h\"~%") ; local dbus config

;; w32api/basetyps.h defines interface to struct
;; which breaks dbus declarations like dbus_message_set_interface below
(c-lines "#undef interface~%")

(c-lines "#include <dbus/dbus.h>~%")

;; === dbus-types.h
(def-c-type dbus_int64_t)
(def-c-type dbus_int32_t)
(def-c-type dbus_uint32_t)
(def-c-type dbus_int16_t)
(def-c-type dbus_unichar_t)
(def-c-type dbus_bool_t)

;; === dbus-macros.h - nothing

;; === dbus-errors.h
(def-c-struct DBusError
  (name c-string)    ; public error name field
  (message c-string) ; public error message field
  (dummy1 uint)
  (dummy2 uint)
  (dummy3 uint)
  (dummy4 uint)
  (dummy5 uint)
  (padding c-pointer))

;; void dbus_error_init (DBusError *error);
(def-call-out dbus_error_init (:return-type nil)
  (:arguments (error (c-pointer DBusError))))

;; void dbus_error_free (DBusError *error);
(def-call-out dbus_error_free (:return-type nil)
  (:arguments (error (c-pointer DBusError))))

;; void dbus_set_error (DBusError *error, const char *name, const char *message, ...);
(def-call-out dbus_set_error (:return-type nil)
  (:arguments (error (c-pointer DBusError))
              (name c-string) (message c-string)))

;; void dbus_set_error_const (DBusError *error, const char *name, const char *message);
(def-call-out dbus_set_error_const (:return-type nil)
  (:arguments (error (c-pointer DBusError))
              (name c-string) (message c-string)))

;; void dbus_move_error (DBusError *src, DBusError *dest);
(def-call-out dbus_move_error (:return-type nil)
  (:arguments (src (c-pointer DBusError))
              (dst (c-pointer DBusError))))

;; dbus_bool_t dbus_error_has_name (const DBusError *error, const char *name);
(def-call-out dbus_error_has_name (:return-type dbus_bool_t)
  (:arguments (error (c-pointer DBusError)) (name c-string)))

;; dbus_bool_t dbus_error_is_set (const DBusError *error);
(def-call-out dbus_error_is_set (:return-type dbus_bool_t)
  (:arguments (error (c-pointer DBusError))))

;; === dbus-address.h
;; Opaque type representing one of the semicolon-separated items in an address
;;   typedef struct DBusAddressEntry DBusAddressEntry;
(def-c-type DBusAddressEntry* c-pointer)

;; dbus_bool_t dbus_parse_address (const char *address, DBusAddressEntry ***entry, int *array_len, DBusError *error);
(def-call-out dbus_parse_address (:return-type dbus_bool_t)
  (:arguments (address c-string)
              (entry (c-ptr (c-pointer DBusAddressEntry*)) :out)
              (array_len (c-ptr int) :out)
              (error (c-pointer DBusError))))

;; const char *dbus_address_entry_get_value (DBusAddressEntry *entry, const char *key);
(def-call-out dbus_address_entry_get_value (:return-type c-string)
  (:arguments (entry DBusAddressEntry*) (key c-string)))

;; const char *dbus_address_entry_get_method (DBusAddressEntry *entry);
(def-call-out dbus_address_entry_get_method (:return-type c-string)
  (:arguments (entry DBusAddressEntry*)))

;; void dbus_address_entries_free (DBusAddressEntry **entries);
(def-call-out dbus_address_entries_free (:return-type nil)
  (:arguments (entries (c-pointer DBusAddressEntry*))))

;; char* dbus_address_escape_value (const char *value);
(def-call-out dbus_address_escape_value (:return-type c-string)
  (:arguments (value c-string)))

;; char* dbus_address_unescape_value (const char *value, DBusError *error);
(def-call-out dbus_address_unescape_value (:return-type c-string)
  (:arguments (value c-string) (error (c-pointer DBusError))))

;; === dbus-memory.h

;; void* dbus_malloc (size_t bytes);
(def-call-out dbus_malloc (:return-type c-pointer) (:arguments (bytes size_t)))

;; void* dbus_malloc0 (size_t bytes);
(def-call-out dbus_malloc0 (:return-type c-pointer) (:arguments (bytes size_t)))

;; void* dbus_realloc (void *memory, size_t bytes);
(def-call-out dbus_realloc (:return-type c-pointer)
  (:arguments (memory c-pointer) (bytes size_t)))

;; void dbus_free (void *memory);
(def-call-out dbus_free (:return-type nil) (:arguments (memory c-pointer)))

;; void dbus_free_string_array (char **str_array);
(def-call-out dbus_free_string_array (:return-type nil)
  (:arguments (str_array (c-array-ptr c-string))))

;; typedef void (* DBusFreeFunction) (void *memory);
(def-c-type DBusFreeFunction
  (c-function (:return-type nil) (:arguments (memory c-pointer))))

;; void dbus_shutdown (void);
(def-call-out dbus_shutdown (:return-type nil) (:arguments))

;; === dbus-message.h
;; typedef struct DBusMessage DBusMessage;
;; Opaque type representing a message iterator.
;; Can be copied by value, and contains no allocated memory so never
;; needs to be freed and can be allocated on the stack.
;; typedef struct DBusMessageIter DBusMessageIter;
(def-c-type DBusMessage* c-pointer)
(def-c-type DBusMessageIter (c-struct DBusMessageIter
  (dummy1 c-pointer)            ; Don't use this
  (dummy2 c-pointer)            ; Don't use this
  (dummy3 dbus_uint32_t)        ; Don't use this
  (dummy4 int)                  ; Don't use this
  (dummy5 int)                  ; Don't use this
  (dummy6 int)                  ; Don't use this
  (dummy7 int)                  ; Don't use this
  (dummy8 int)                  ; Don't use this
  (dummy9 int)                  ; Don't use this
  (dummy10 int)                 ; Don't use this
  (dummy11 int)                 ; Don't use this
  (pad1 int)                    ; Don't use this
  (pad2 int)                    ; Don't use this
  (pad3 c-pointer)              ; Don't use this
  ))
(def-c-type DBusMessageIter* (c-pointer DBusMessageIter))

;; DBusMessage* dbus_message_new (int message_type);
(def-call-out dbus_message_new (:return-type DBusMessage*)
  (:arguments (message_type int)))

;; DBusMessage* dbus_message_new_method_call (const char *bus_name, const char *path, const char *interface, const char *method);
(def-call-out dbus_message_new_method_call (:return-type DBusMessage*)
  (:arguments (bus_name c-string) (path c-string)
              (interface c-string) (method c-string)))

;; DBusMessage* dbus_message_new_method_return (DBusMessage *method_call);
(def-call-out dbus_message_new_method_return (:return-type DBusMessage*)
  (:arguments (method_call DBusMessage*)))

;; DBusMessage* dbus_message_new_signal (const char *path, const char *interface, const char *name);
(def-call-out dbus_message_new_signal (:return-type DBusMessage*)
  (:arguments (path c-string) (interface c-string) (name c-string)))

;; DBusMessage* dbus_message_new_error (DBusMessage *reply_to, const char *error_name, const char *error_message);
(def-call-out dbus_message_new_error (:return-type DBusMessage*)
  (:arguments (reply_to DBusMessage*) (error_name c-string)
              (error_message c-string)))

;; DBusMessage* dbus_message_new_error_printf (DBusMessage *reply_to, const char *error_name, const char *error_format, ...);
(defmacro dbus_message_new_error_format (reply_to error_name error_format
                                         &rest args)
  `(dbus_message_new_error ,reply_to ,error_name
                           (format nil ,error_format ,@args)))


;; DBusMessage* dbus_message_copy (const DBusMessage *message);
(def-call-out dbus_message_copy (:return-type DBusMessage*)
  (:arguments (message DBusMessage*)))


;; DBusMessage* dbus_message_ref (DBusMessage *message);
(def-call-out dbus_message_ref (:return-type DBusMessage*)
  (:arguments (message DBusMessage*)))

;; void dbus_message_unref (DBusMessage *message);
(def-call-out dbus_message_unref (:return-type nil)
  (:arguments (message DBusMessage*)))

;; int dbus_message_get_type (DBusMessage *message);
(def-call-out dbus_message_get_type (:return-type int)
  (:arguments (message DBusMessage*)))

;; dbus_bool_t dbus_message_set_path (DBusMessage *message, const char *object_path);
(def-call-out dbus_message_set_path (:return-type dbus_bool_t)
  (:arguments (message DBusMessage*) (object_path c-string)))

;; const char* dbus_message_get_path (DBusMessage *message);
(def-call-out dbus_message_get_path (:return-type c-string)
  (:arguments (message DBusMessage*)))

;; dbus_bool_t dbus_message_has_path (DBusMessage *message, const char *object_path);
(def-call-out dbus_message_has_path (:return-type dbus_bool_t)
  (:arguments (message DBusMessage*) (object_path c-string)))

;; dbus_bool_t dbus_message_set_interface (DBusMessage *message, const char *interface);
(def-call-out dbus_message_set_interface (:return-type dbus_bool_t)
  (:arguments (message DBusMessage*) (interface c-string)))

;; const char* dbus_message_get_interface (DBusMessage *message);
(def-call-out dbus_message_get_interface (:return-type c-string)
  (:arguments (message DBusMessage*)))

;; dbus_bool_t dbus_message_has_interface (DBusMessage *message, const char *interface);
(def-call-out dbus_message_has_interface (:return-type dbus_bool_t)
  (:arguments (message DBusMessage*) (interface c-string)))

;; dbus_bool_t dbus_message_set_member (DBusMessage *message, const char *member);
(def-call-out dbus_message_set_member (:return-type dbus_bool_t)
  (:arguments (message DBusMessage*) (member c-string)))

;; const char* dbus_message_get_member (DBusMessage *message);
(def-call-out dbus_message_get_member (:return-type c-string)
  (:arguments (message DBusMessage*)))

;; dbus_bool_t dbus_message_has_member (DBusMessage *message, const char *member);
(def-call-out dbus_message_has_member (:return-type dbus_bool_t)
  (:arguments (message DBusMessage*) (member c-string)))

;; dbus_bool_t dbus_message_set_error_name (DBusMessage *message, const char *name);
(def-call-out dbus_message_set_error_name (:return-type dbus_bool_t)
  (:arguments (message DBusMessage*) (name c-string)))

;; const char* dbus_message_get_error_name (DBusMessage *message);
(def-call-out dbus_message_get_error_name (:return-type c-string)
  (:arguments (message DBusMessage*)))

;; dbus_bool_t dbus_message_set_destination (DBusMessage *message, const char *destination);
(def-call-out dbus_message_set_destination (:return-type dbus_bool_t)
  (:arguments (message DBusMessage*) (destination c-string)))

;; const char* dbus_message_get_destination (DBusMessage *message);
(def-call-out dbus_message_get_destination (:return-type c-string)
  (:arguments (message DBusMessage*)))

;; dbus_bool_t dbus_message_set_sender (DBusMessage *message, const char *sender);
(def-call-out dbus_message_set_sender (:return-type dbus_bool_t)
  (:arguments (message DBusMessage*) (sender c-string)))

;; const char* dbus_message_get_sender (DBusMessage *message);
(def-call-out dbus_message_get_sender (:return-type c-string)
  (:arguments (message DBusMessage*)))

;; const char* dbus_message_get_signature (DBusMessage *message);
(def-call-out dbus_message_get_signature (:return-type c-string)
  (:arguments (message DBusMessage*)))

;; void dbus_message_set_no_reply (DBusMessage *message, dbus_bool_t no_reply);
(def-call-out dbus_message_set_no_reply (:return-type nil)
  (:arguments (message DBusMessage*) (no_reply dbus_bool_t)))

;; dbus_bool_t dbus_message_get_no_reply (DBusMessage *message);
(def-call-out dbus_message_get_no_reply (:return-type dbus_bool_t)
  (:arguments (message DBusMessage*)))

;; dbus_bool_t dbus_message_is_method_call (DBusMessage *message, const char *interface, const char *method);
(def-call-out dbus_message_is_method_call (:return-type dbus_bool_t)
  (:arguments (message DBusMessage*) (interface c-string) (method c-string)))

;; dbus_bool_t dbus_message_is_signal (DBusMessage *message, const char *interface, const char *signal_name);
(def-call-out dbus_message_is_signal (:return-type dbus_bool_t)
  (:arguments (message DBusMessage*) (interface c-string)
              (signal_name c-string)))

;; dbus_bool_t dbus_message_is_error (DBusMessage *message, const char *error_name);
(def-call-out dbus_message_is_error (:return-type dbus_bool_t)
  (:arguments (message DBusMessage*) (error_name c-string)))

;; dbus_bool_t dbus_message_has_destination (DBusMessage *message, const char *bus_name);
(def-call-out dbus_message_has_destination (:return-type dbus_bool_t)
  (:arguments (message DBusMessage*) (bus_name c-string)))

;; dbus_bool_t dbus_message_has_sender (DBusMessage *message, const char *unique_bus_name);
(def-call-out dbus_message_has_sender (:return-type dbus_bool_t)
  (:arguments (message DBusMessage*) (unique_bus_name c-string)))

;; dbus_bool_t dbus_message_has_signature (DBusMessage *message, const char *signature);
(def-call-out dbus_message_has_signature (:return-type dbus_bool_t)
  (:arguments (message DBusMessage*) (signature c-string)))

;; dbus_uint32_t dbus_message_get_serial (DBusMessage *message);
(def-call-out dbus_message_get_serial (:return-type dbus_uint32_t)
  (:arguments (message DBusMessage*)))

;; void dbus_message_set_serial (DBusMessage *message, dbus_uint32_t serial);
(def-call-out dbus_message_set_serial (:return-type nil)
  (:arguments (message DBusMessage*) (serial dbus_uint32_t)))

;; dbus_bool_t dbus_message_set_reply_serial (DBusMessage *message, dbus_uint32_t reply_serial);
(def-call-out dbus_message_set_reply_serial (:return-type dbus_bool_t)
  (:arguments (message DBusMessage*) (reply_serial dbus_uint32_t)))

;; dbus_uint32_t dbus_message_get_reply_serial (DBusMessage *message);
(def-call-out dbus_message_get_reply_serial (:return-type dbus_uint32_t)
  (:arguments (message DBusMessage*)))


;; void dbus_message_set_auto_start (DBusMessage *message, dbus_bool_t auto_start);
(def-call-out dbus_message_set_auto_start (:return-type nil)
  (:arguments (message DBusMessage*) (auto_start dbus_bool_t)))

;; dbus_bool_t dbus_message_get_auto_start (DBusMessage *message);
(def-call-out dbus_message_get_auto_start (:return-type dbus_bool_t)
  (:arguments (message DBusMessage*)))


;; dbus_bool_t dbus_message_get_path_decomposed (DBusMessage *message, char ***path);
(def-call-out dbus_message_get_path_decomposed (:return-type dbus_bool_t)
  (:arguments (message DBusMessage*)
              (path (c-ptr (c-array-ptr c-string)) :out)))


;; dbus_bool_t dbus_message_append_args (DBusMessage *message, int first_arg_type, ...);
;(def-call-out dbus_message_append_args (:return-type dbus_bool_t)
;  (:arguments (message DBusMessage*) (first_arg_type int) (... )))

;; dbus_bool_t dbus_message_append_args_valist (DBusMessage *message, int first_arg_type, va_list var_args);
;(def-call-out dbus_message_append_args_valist (:return-type dbus_bool_t)
;  (:arguments (message DBusMessage*) (first_arg_type int) (var_args va_list)))

;; dbus_bool_t dbus_message_get_args (DBusMessage *message, DBusError *error, int first_arg_type, ...);
;(def-call-out dbus_message_get_args (:return-type dbus_bool_t)
;  (:arguments (message DBusMessage*) (error (c-pointer DBusError)) (first_arg_type int) (... )))

;; dbus_bool_t dbus_message_get_args_valist (DBusMessage *message, DBusError *error, int first_arg_type, va_list var_args);
;(def-call-out dbus_message_get_args_valist (:return-type dbus_bool_t)
;  (:arguments (message DBusMessage*) (error (c-pointer DBusError)) (first_arg_type int) (var_args va_list)))



;; dbus_bool_t dbus_message_iter_init (DBusMessage *message, DBusMessageIter *iter);
(def-call-out dbus_message_iter_init (:return-type dbus_bool_t)
  (:arguments (message DBusMessage*) (iter DBusMessageIter*)))

;; dbus_bool_t dbus_message_iter_has_next (DBusMessageIter *iter);
(def-call-out dbus_message_iter_has_next (:return-type dbus_bool_t)
  (:arguments (iter DBusMessageIter*)))

;; dbus_bool_t dbus_message_iter_next (DBusMessageIter *iter);
(def-call-out dbus_message_iter_next (:return-type dbus_bool_t)
  (:arguments (iter DBusMessageIter*)))

;; char* dbus_message_iter_get_signature (DBusMessageIter *iter);
(def-call-out dbus_message_iter_get_signature (:return-type c-string)
  (:arguments (iter DBusMessageIter*)))

;; int dbus_message_iter_get_arg_type (DBusMessageIter *iter);
(def-call-out dbus_message_iter_get_arg_type (:return-type int)
  (:arguments (iter DBusMessageIter*)))

;; int dbus_message_iter_get_element_type (DBusMessageIter *iter);
(def-call-out dbus_message_iter_get_element_type (:return-type int)
  (:arguments (iter DBusMessageIter*)))

;; void dbus_message_iter_recurse (DBusMessageIter *iter, DBusMessageIter *sub);
(def-call-out dbus_message_iter_recurse (:return-type nil)
  (:arguments (iter DBusMessageIter*) (sub DBusMessageIter*)))

;; void dbus_message_iter_get_basic (DBusMessageIter *iter, void *value);
(def-call-out dbus_message_iter_get_basic (:return-type nil)
  (:arguments (iter DBusMessageIter*) (value c-pointer)))

;; void dbus_message_iter_get_fixed_array (DBusMessageIter *iter, void *value, int *n_elements);
(def-call-out dbus_message_iter_get_fixed_array (:return-type nil)
  (:arguments (iter DBusMessageIter*) (value c-pointer)
              (n_elements (c-ptr int) :out)))



;; void dbus_message_iter_init_append (DBusMessage *message, DBusMessageIter *iter);
(def-call-out dbus_message_iter_init_append (:return-type nil)
  (:arguments (message DBusMessage*) (iter DBusMessageIter*)))

;; dbus_bool_t dbus_message_iter_append_basic (DBusMessageIter *iter, int type, const void *value);
(def-call-out dbus_message_iter_append_basic (:return-type dbus_bool_t)
  (:arguments (iter DBusMessageIter*) (type int) (value c-pointer)))

;; dbus_bool_t dbus_message_iter_append_fixed_array (DBusMessageIter *iter, int element_type, const void *value, int n_elements);
(def-call-out dbus_message_iter_append_fixed_array (:return-type dbus_bool_t)
  (:arguments (iter DBusMessageIter*) (element_type int)
              (value c-pointer) (n_elements int)))

;; dbus_bool_t dbus_message_iter_open_container (DBusMessageIter *iter, int type, const char *contained_signature, DBusMessageIter *sub);
(def-call-out dbus_message_iter_open_container (:return-type dbus_bool_t)
  (:arguments (iter DBusMessageIter*) (type int)
              (contained_signature c-string) (sub DBusMessageIter*)))

;; dbus_bool_t dbus_message_iter_close_container (DBusMessageIter *iter, DBusMessageIter *sub);
(def-call-out dbus_message_iter_close_container (:return-type dbus_bool_t)
  (:arguments (iter DBusMessageIter*) (sub DBusMessageIter*)))

;; void dbus_message_lock (DBusMessage *message);
(def-call-out dbus_message_lock (:return-type nil)
  (:arguments (message DBusMessage*)))

;; dbus_bool_t dbus_set_error_from_message (DBusError *error, DBusMessage *message);
(def-call-out dbus_set_error_from_message (:return-type dbus_bool_t)
  (:arguments (error (c-pointer DBusError)) (message DBusMessage*)))



;; dbus_bool_t dbus_message_allocate_data_slot (dbus_int32_t *slot_p);
(def-call-out dbus_message_allocate_data_slot (:return-type dbus_bool_t)
  (:arguments (slot_p (c-pointer dbus_int32_t))))

;; void dbus_message_free_data_slot (dbus_int32_t *slot_p);
(def-call-out dbus_message_free_data_slot (:return-type nil)
  (:arguments (slot_p (c-pointer dbus_int32_t))))

;; dbus_bool_t dbus_message_set_data (DBusMessage *message, dbus_int32_t slot, void *data, DBusFreeFunction free_data_func);
(def-call-out dbus_message_set_data (:return-type dbus_bool_t)
  (:arguments (message DBusMessage*) (slot dbus_int32_t) (data c-pointer)
              (free_data_func DBusFreeFunction)))

;; void* dbus_message_get_data (DBusMessage *message, dbus_int32_t slot);
(def-call-out dbus_message_get_data (:return-type c-pointer)
  (:arguments (message DBusMessage*) (slot dbus_int32_t)))


;; int dbus_message_type_from_string (const char *type_str);
(def-call-out dbus_message_type_from_string (:return-type int)
  (:arguments (type_str c-string)))

;; const char * dbus_message_type_to_string (int type);
(def-call-out dbus_message_type_to_string (:return-type c-string)
  (:arguments (type int)))

;; dbus_bool_t dbus_message_marshal (DBusMessage *msg, char **marshalled_data_p, int *len_p);
(def-call-out dbus_message_marshal (:return-type dbus_bool_t)
  (:arguments (msg DBusMessage*)
              (marshalled_data_p (c-ptr c-pointer) :out)
              (len_p (c-ptr int) :out)))

;; DBusMessage* dbus_message_demarshal (const char *str, int len, DBusError *error);
(def-call-out dbus_message_demarshal (:return-type DBusMessage*)
  (:arguments (str c-pointer) (len int) (error (c-pointer DBusError))))

;; int dbus_message_demarshal_bytes_needed (const char *str, int len);
(def-call-out dbus_message_demarshal_bytes_needed (:return-type int)
  (:arguments (str c-pointer) (len int)))


;; === dbus-shared.h

(def-c-enum DBusBusType         ; see dbus_bus_get
  DBUS_BUS_SESSION              ; The login session bus
  DBUS_BUS_SYSTEM               ; The systemwide bus
  DBUS_BUS_STARTER)             ; The bus that started us, if any

(def-c-enum DBusHandlerResult   ; Results that a message handler can return
  DBUS_HANDLER_RESULT_HANDLED ; Message has had its effect - no need to run more handlers.
  DBUS_HANDLER_RESULT_NOT_YET_HANDLED ; Message has not had any effect - see if other handlers want it.
  DBUS_HANDLER_RESULT_NEED_MEMORY ; Need more memory in order to return #DBUS_HANDLER_RESULT_HANDLED or #DBUS_HANDLER_RESULT_NOT_YET_HANDLED. Please try again later with more memory.
  )

;; Bus names
(def-c-const DBUS_SERVICE_DBUS (:type c-string) ; "org.freedesktop.DBus"
  (:documentation "The bus name used to talk to the bus itself."))

;; Paths
(def-c-const DBUS_PATH_DBUS (:type c-string) ; "/org/freedesktop/DBus"
  (:documentation "The object path used to talk to the bus itself."))
(def-c-const DBUS_PATH_LOCAL (:type c-string) ; "/org/freedesktop/DBus/Local"
  (:documentation "The object path used in local/in-process-generated messages."))

;; Interfaces, these #define don't do much other than catch typos at compile time
(def-c-const DBUS_INTERFACE_DBUS (:type c-string) ; "org.freedesktop.DBus"
  (:documentation "The interface exported by the object with #DBUS_SERVICE_DBUS and #DBUS_PATH_DBUS"))
(def-c-const DBUS_INTERFACE_INTROSPECTABLE (:type c-string) ; "org.freedesktop.DBus.Introspectable"
  (:documentation "The interface supported by introspectable objects."))
(def-c-const DBUS_INTERFACE_PROPERTIES (:type c-string) ; "org.freedesktop.DBus.Properties"
  (:documentation "The interface supported by objects with properties."))
(def-c-const DBUS_INTERFACE_PEER (:type c-string) ; "org.freedesktop.DBus.Peer"
  (:documentation "The interface supported by most dbus peers."))
(def-c-const DBUS_INTERFACE_LOCAL (:type c-string) ; "org.freedesktop.DBus.Local"
  (:documentation "This is a special interface whose methods can only be invoked by the local implementation (messages from remote apps aren't allowed to specify this interface)."))

;; Owner flags
(def-c-const DBUS_NAME_FLAG_ALLOW_REPLACEMENT ; 0x1
  (:documentation "Allow another service to become the primary owner if requested"))
(def-c-const DBUS_NAME_FLAG_REPLACE_EXISTING ; 0x2
  (:documentation "Request to replace the current primary owner"))
(def-c-const DBUS_NAME_FLAG_DO_NOT_QUEUE ; 0x4
  (:documentation "If we can not become the primary owner do not place us in the queue"))

;; Replies to request for a name
(def-c-const DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER ; 1
  (:documentation "Service has become the primary owner of the requested name"))
(def-c-const DBUS_REQUEST_NAME_REPLY_IN_QUEUE ; 2
  (:documentation "Service could not become the primary owner and has been placed in the queue"))
(def-c-const DBUS_REQUEST_NAME_REPLY_EXISTS ; 3
  (:documentation "Service is already in the queue"))
(def-c-const DBUS_REQUEST_NAME_REPLY_ALREADY_OWNER ; 4
  (:documentation "Service is already the primary owner"))

;; Replies to releasing a name
(def-c-const DBUS_RELEASE_NAME_REPLY_RELEASED ; 1
  (:documentation "Service was released from the given name"))
(def-c-const DBUS_RELEASE_NAME_REPLY_NON_EXISTENT ; 2
  (:documentation "The given name does not exist on the bus"))
(def-c-const DBUS_RELEASE_NAME_REPLY_NOT_OWNER ; 3
  (:documentation "Service is not an owner of the given name"))

;; Replies to service starts
(def-c-const DBUS_START_REPLY_SUCCESS ; 1
  (:documentation "Service was auto started"))
(def-c-const DBUS_START_REPLY_ALREADY_RUNNING ; 2
  (:documentation "Service was already running"))

;; === dbus-connection.h

;; documented in dbus-watch.c
;; typedef struct DBusWatch DBusWatch;
(def-c-type DBusWatch* c-pointer)

;; documented in dbus-timeout.c
;; typedef struct DBusTimeout DBusTimeout;
(def-c-type DBusTimeout* c-pointer)

;; Opaque type representing preallocated resources so a message
;; can be sent without further memory allocation.
;; typedef struct DBusPreallocatedSend DBusPreallocatedSend;
(def-c-type DBusPreallocatedSend* c-pointer)

;; Opaque type representing a method call that has not yet received a reply.
;; typedef struct DBusPendingCall DBusPendingCall;
(def-c-type DBusPendingCall* c-pointer)

;; Opaque type representing a connection to a remote application
;; and associated incoming/outgoing message queues.
;; typedef struct DBusConnection DBusConnection;
(def-c-type DBusConnection* c-pointer)

;; Set of functions that must be implemented to handle messages
;; sent to a particular object path.
;; typedef struct DBusObjectPathVTable DBusObjectPathVTable;
(def-c-type DBusObjectPathVTable* c-pointer)

(def-c-enum DBusWatchFlags        ; Indicates the status of a #DBusWatch
  (DBUS_WATCH_READABLE (ash 1 0)) ; As in POLLIN
  (DBUS_WATCH_WRITABLE (ash 1 1)) ; As in POLLOUT
  (DBUS_WATCH_ERROR (ash 1 2)) ; As in POLLERR (can't watch for this, but can be present in current state passed to dbus_watch_handle()).
  (DBUS_WATCH_HANGUP (ash 1 3)) ; As in POLLHUP (can't watch for it, but can be present in current state passed to dbus_watch_handle()).
  )

;; Indicates the status of incoming data on a #DBusConnection.
;; This determines whether dbus_connection_dispatch() needs to be called.
(def-c-enum DBusDispatchStatus
  DBUS_DISPATCH_DATA_REMAINS ; There is more data to potentially convert to messages.
  DBUS_DISPATCH_COMPLETE ; All currently available data has been processed.
  DBUS_DISPATCH_NEED_MEMORY ; More memory is needed to continue.
  )


;; Called when libdbus needs a new watch to be monitored by the main loop.
;; Returns #FALSE if it lacks enough memory to add the watch.
;; Set by dbus_connection_set_watch_functions()
;; or dbus_server_set_watch_functions().
;; typedef dbus_bool_t (* DBusAddWatchFunction) (DBusWatch *watch, void *data);
(def-c-type DBusAddWatchFunction
  (c-function (:return-type dbus_bool_t)
              (:arguments (watch DBusWatch*) (data c-pointer))))
(def-c-type DBusAddWatchFunction* (c-pointer DBusAddWatchFunction))

;; Called when dbus_watch_get_enabled() may return a different value than
;; it did before.  Set by dbus_connection_set_watch_functions() or
;; dbus_server_set_watch_functions().
;; typedef void (* DBusWatchToggledFunction) (DBusWatch *watch, void *data);
(def-c-type DBusWatchToggledFunction
  (c-function (:return-type nil)
              (:arguments (watch DBusWatch*) (data c-pointer))))
(def-c-type DBusWatchToggledFunction* (c-pointer DBusWatchToggledFunction))

;; Called when libdbus no longer needs a watch to be monitored by the main
;; loop. Set by dbus_connection_set_watch_functions() or
;; dbus_server_set_watch_functions().
;; typedef void (* DBusRemoveWatchFunction) (DBusWatch *watch, void *data);
(def-c-type DBusRemoveWatchFunction
  (c-function (:return-type nil)
              (:arguments (watch DBusWatch*) (data c-pointer))))
(def-c-type DBusRemoveWatchFunction* (c-pointer DBusRemoveWatchFunction))

;; Called when libdbus needs a new timeout to be monitored by the main
;; loop. Returns #FALSE if it lacks enough memory to add the watch.
;; Set by dbus_connection_set_timeout_functions() or
;; dbus_server_set_timeout_functions().
;; typedef dbus_bool_t (* DBusAddTimeoutFunction) (DBusTimeout *timeout, void *data);
(def-c-type DBusAddTimeoutFunction
  (c-function (:return-type dbus_bool_t)
              (:arguments (timeout DBusTimeout*) (data c-pointer))))
(def-c-type DBusAddTimeoutFunction* (c-pointer DBusAddTimeoutFunction))

;; Called when dbus_timeout_get_enabled() may return a different value than
;; it did before.  Set by dbus_connection_set_timeout_functions() or
;; dbus_server_set_timeout_functions().
;; typedef void (* DBusTimeoutToggledFunction) (DBusTimeout *timeout, void *data);
(def-c-type DBusTimeoutToggledFunction
  (c-function (:return-type nil)
              (:arguments (timeout DBusTimeout*) (data c-pointer))))
(def-c-type DBusTimeoutToggledFunction* (c-pointer DBusTimeoutToggledFunction))

;; Called when libdbus no longer needs a timeout to be monitored by the
;; main loop. Set by dbus_connection_set_timeout_functions() or
;; dbus_server_set_timeout_functions().
;; typedef void (* DBusRemoveTimeoutFunction) (DBusTimeout *timeout, void *data);
(def-c-type DBusRemoveTimeoutFunction
  (c-function (:return-type nil)
              (:arguments (timeout DBusTimeout*) (data c-pointer))))
(def-c-type DBusRemoveTimeoutFunction* (c-pointer DBusRemoveTimeoutFunction))

;; Called when the return value of dbus_connection_get_dispatch_status()
;; may have changed. Set with dbus_connection_set_dispatch_status_function().
;; typedef void (* DBusDispatchStatusFunction) (DBusConnection *connection, DBusDispatchStatus new_status, void *data);
(def-c-type DBusDispatchStatusFunction
  (c-function (:return-type nil)
              (:arguments (connection DBusConnection*)
                          (new_status DBusDispatchStatus) (data c-pointer))))
(def-c-type DBusDispatchStatusFunction* (c-pointer DBusDispatchStatusFunction))


;; Called when the main loop's thread should be notified that there's now
;; work to do. Set with dbus_connection_set_wakeup_main_function().
;; typedef void (* DBusWakeupMainFunction) (void *data);
(def-c-type DBusWakeupMainFunction
  (c-function (:return-type nil)
              (:arguments (data c-pointer))))
(def-c-type DBusWakeupMainFunction* (c-pointer DBusWakeupMainFunction))


;; Called during authentication to check whether the given UNIX user
;; ID is allowed to connect, if the client tried to auth as a UNIX user ID.
;; Normally on Windows this would never happen.
;; Set with dbus_connection_set_unix_user_function().
;; typedef dbus_bool_t (* DBusAllowUnixUserFunction) (DBusConnection *connection, unsigned long uid, void *data);
(def-c-type DBusAllowUnixUserFunction
  (c-function (:return-type dbus_bool_t)
              (:arguments (connection DBusConnection*)
                          (uid ulong) (data c-pointer))))
(def-c-type DBusAllowUnixUserFunction* (c-pointer DBusAllowUnixUserFunction))


;; Called during authentication to check whether the given Windows user
;; ID is allowed to connect, if the client tried to auth as a Windows user ID.
;; Normally on UNIX this would never happen.
;; Set with dbus_connection_set_windows_user_function().
;; typedef dbus_bool_t (* DBusAllowWindowsUserFunction) (DBusConnection *connection, const char *user_sid, void *data);
(def-c-type DBusAllowWindowsUserFunction
  (c-function (:return-type dbus_bool_t)
              (:arguments (connection DBusConnection*)
                          (user_sid c-string) (data c-pointer))))
(def-c-type DBusAllowWindowsUserFunction* (c-pointer DBusAllowWindowsUserFunction))

;; Called when a pending call now has a reply available.
;; Set with dbus_pending_call_set_notify().
;; typedef void (* DBusPendingCallNotifyFunction) (DBusPendingCall *pending, void *user_data);
(def-c-type DBusPendingCallNotifyFunction
  (c-function (:return-type nil)
              (:arguments (pending DBusPendingCall*) (user_data c-pointer))))
(def-c-type DBusPendingCallNotifyFunction*
  (c-pointer DBusPendingCallNotifyFunction))



;; Called when a message needs to be handled. The result indicates whether
;; or not more handlers should be run. Set with dbus_connection_add_filter().
;; typedef DBusHandlerResult (* DBusHandleMessageFunction) (DBusConnection *connection, DBusMessage *message, void *user_data);
(def-c-type DBusHandleMessageFunction
  (c-function (:return-type DBusHandlerResult)
              (:arguments (connection DBusConnection*) (message DBusMessage*)
                          (user_data c-pointer))))
(def-c-type DBusHandleMessageFunction* (c-pointer DBusHandleMessageFunction))


;; DBusConnection* dbus_connection_open (const char *address, DBusError *error);
(def-call-out dbus_connection_open (:return-type DBusConnection*)
  (:arguments (address c-string) (error (c-pointer DBusError))))

;; DBusConnection* dbus_connection_open_private (const char *address, DBusError *error);
(def-call-out dbus_connection_open_private (:return-type DBusConnection*)
  (:arguments (address c-string) (error (c-pointer DBusError))))

;; DBusConnection* dbus_connection_ref (DBusConnection *connection);
(def-call-out dbus_connection_ref (:return-type DBusConnection*)
  (:arguments (connection DBusConnection*)))

;; void dbus_connection_unref (DBusConnection *connection);
(def-call-out dbus_connection_unref (:return-type nil)
  (:arguments (connection DBusConnection*)))

;; void dbus_connection_close (DBusConnection *connection);
(def-call-out dbus_connection_close (:return-type nil)
  (:arguments (connection DBusConnection*)))

;; dbus_bool_t dbus_connection_get_is_connected (DBusConnection *connection);
(def-call-out dbus_connection_get_is_connected (:return-type dbus_bool_t)
  (:arguments (connection DBusConnection*)))

;; dbus_bool_t dbus_connection_get_is_authenticated (DBusConnection *connection);
(def-call-out dbus_connection_get_is_authenticated (:return-type dbus_bool_t)
  (:arguments (connection DBusConnection*)))

;; dbus_bool_t dbus_connection_get_is_anonymous (DBusConnection *connection);
(def-call-out dbus_connection_get_is_anonymous (:return-type dbus_bool_t)
  (:arguments (connection DBusConnection*)))

;; char* dbus_connection_get_server_id (DBusConnection *connection);
(def-call-out dbus_connection_get_server_id (:return-type c-string)
  (:arguments (connection DBusConnection*)))

;; void dbus_connection_set_exit_on_disconnect (DBusConnection *connection, dbus_bool_t exit_on_disconnect);
(def-call-out dbus_connection_set_exit_on_disconnect (:return-type nil)
  (:arguments (connection DBusConnection*) (exit_on_disconnect dbus_bool_t)))

;; void dbus_connection_flush (DBusConnection *connection);
(def-call-out dbus_connection_flush (:return-type nil)
  (:arguments (connection DBusConnection*)))

;; dbus_bool_t dbus_connection_read_write_dispatch (DBusConnection *connection, int timeout_milliseconds);
(def-call-out dbus_connection_read_write_dispatch (:return-type dbus_bool_t)
  (:arguments (connection DBusConnection*) (timeout_milliseconds int)))

;; dbus_bool_t dbus_connection_read_write (DBusConnection *connection, int timeout_milliseconds);
(def-call-out dbus_connection_read_write (:return-type dbus_bool_t)
  (:arguments (connection DBusConnection*) (timeout_milliseconds int)))

;; DBusMessage* dbus_connection_borrow_message (DBusConnection *connection);
(def-call-out dbus_connection_borrow_message (:return-type DBusMessage*)
  (:arguments (connection DBusConnection*)))

;; void dbus_connection_return_message (DBusConnection *connection, DBusMessage *message);
(def-call-out dbus_connection_return_message (:return-type nil)
  (:arguments (connection DBusConnection*) (message DBusMessage*)))

;; void dbus_connection_steal_borrowed_message (DBusConnection *connection, DBusMessage *message);
(def-call-out dbus_connection_steal_borrowed_message (:return-type nil)
  (:arguments (connection DBusConnection*) (message DBusMessage*)))

;; DBusMessage* dbus_connection_pop_message (DBusConnection *connection);
(def-call-out dbus_connection_pop_message (:return-type DBusMessage*)
  (:arguments (connection DBusConnection*)))

;; DBusDispatchStatus dbus_connection_get_dispatch_status (DBusConnection *connection);
(def-call-out dbus_connection_get_dispatch_status (:return-type DBusDispatchStatus)
  (:arguments (connection DBusConnection*)))

;; DBusDispatchStatus dbus_connection_dispatch (DBusConnection *connection);
(def-call-out dbus_connection_dispatch (:return-type DBusDispatchStatus)
  (:arguments (connection DBusConnection*)))

;; dbus_bool_t dbus_connection_has_messages_to_send (DBusConnection *connection);
(def-call-out dbus_connection_has_messages_to_send (:return-type dbus_bool_t)
  (:arguments (connection DBusConnection*)))

;; dbus_bool_t dbus_connection_send (DBusConnection *connection, DBusMessage *message, dbus_uint32_t *client_serial);
(def-call-out dbus_connection_send (:return-type dbus_bool_t)
  (:arguments (connection DBusConnection*) (message DBusMessage*)
              (client_serial (c-ptr dbus_uint32_t) :out)))

;; dbus_bool_t dbus_connection_send_with_reply (DBusConnection *connection, DBusMessage *message, DBusPendingCall **pending_return, int timeout_milliseconds);
(def-call-out dbus_connection_send_with_reply (:return-type dbus_bool_t)
  (:arguments (connection DBusConnection*) (message DBusMessage*)
              (pending_return (c-ptr DBusPendingCall*) :out) ;??
              (timeout_milliseconds int)))

;; DBusMessage * dbus_connection_send_with_reply_and_block (DBusConnection *connection, DBusMessage *message, int timeout_milliseconds, DBusError *error);
(def-call-out dbus_connection_send_with_reply_and_block (:return-type DBusMessage*)
  (:arguments (connection DBusConnection*) (message DBusMessage*)
              (timeout_milliseconds int) (error (c-pointer DBusError))))

;; dbus_bool_t dbus_connection_set_watch_functions (DBusConnection *connection, DBusAddWatchFunction add_function, DBusRemoveWatchFunction remove_function, DBusWatchToggledFunction toggled_function, void *data, DBusFreeFunction free_data_function);
(def-call-out dbus_connection_set_watch_functions (:return-type dbus_bool_t)
  (:arguments (connection DBusConnection*)
              (add_function DBusAddWatchFunction)
              (remove_function DBusRemoveWatchFunction)
              (toggled_function DBusWatchToggledFunction)
              (data c-pointer) (free_data_function DBusFreeFunction)))

;; dbus_bool_t dbus_connection_set_timeout_functions (DBusConnection *connection, DBusAddTimeoutFunction add_function, DBusRemoveTimeoutFunction remove_function, DBusTimeoutToggledFunction toggled_function, void *data, DBusFreeFunction free_data_function);
(def-call-out dbus_connection_set_timeout_functions (:return-type dbus_bool_t)
  (:arguments (connection DBusConnection*)
              (add_function DBusAddTimeoutFunction)
              (remove_function DBusRemoveTimeoutFunction)
              (toggled_function DBusTimeoutToggledFunction)
              (data c-pointer) (free_data_function DBusFreeFunction)))

;; void dbus_connection_set_wakeup_main_function (DBusConnection *connection, DBusWakeupMainFunction wakeup_main_function, void *data, DBusFreeFunction free_data_function);
(def-call-out dbus_connection_set_wakeup_main_function (:return-type nil)
  (:arguments (connection DBusConnection*)
              (wakeup_main_function DBusWakeupMainFunction)
              (data c-pointer) (free_data_function DBusFreeFunction)))

;; void dbus_connection_set_dispatch_status_function (DBusConnection *connection, DBusDispatchStatusFunction function, void *data, DBusFreeFunction free_data_function);
(def-call-out dbus_connection_set_dispatch_status_function (:return-type nil)
  (:arguments (connection DBusConnection*)
              (function DBusDispatchStatusFunction)
              (data c-pointer) (free_data_function DBusFreeFunction)))

;; dbus_bool_t dbus_connection_get_unix_user (DBusConnection *connection, unsigned long *uid);
(def-call-out dbus_connection_get_unix_user (:return-type dbus_bool_t)
  (:arguments (connection DBusConnection*) (uid (c-ptr ulong) :out)))

;; dbus_bool_t dbus_connection_get_unix_process_id (DBusConnection *connection, unsigned long *pid);
(def-call-out dbus_connection_get_unix_process_id (:return-type dbus_bool_t)
  (:arguments (connection DBusConnection*) (pid (c-ptr ulong) :out)))

;; dbus_bool_t dbus_connection_get_adt_audit_session_data (DBusConnection *connection, void **data, dbus_int32_t *data_size);
(def-call-out dbus_connection_get_adt_audit_session_data
    (:arguments (connection DBusConnection*)
                (data (c-ptr c-pointer) :out)
                (data_size (c-ptr dbus_int32_t) :out))
  (:return-type dbus_bool_t))

;; void dbus_connection_set_unix_user_function (DBusConnection *connection, DBusAllowUnixUserFunction function, void *data, DBusFreeFunction free_data_function);
(def-call-out dbus_connection_set_unix_user_function (:return-type nil)
  (:arguments (connection DBusConnection*) (function DBusAllowUnixUserFunction)
              (data c-pointer) (free_data_function DBusFreeFunction)))

;; dbus_bool_t dbus_connection_get_windows_user (DBusConnection *connection, char **windows_sid_p);
(def-call-out dbus_connection_get_windows_user (:return-type dbus_bool_t)
  (:arguments (connection DBusConnection*)
              (windows_sid_p (c-ptr c-string) :out)))

;; void dbus_connection_set_windows_user_function (DBusConnection *connection, DBusAllowWindowsUserFunction function, void *data, DBusFreeFunction free_data_function);
(def-call-out dbus_connection_set_windows_user_function (:return-type nil)
  (:arguments (connection DBusConnection*)
              (function DBusAllowWindowsUserFunction) (data c-pointer)
              (free_data_function DBusFreeFunction)))

;; void dbus_connection_set_allow_anonymous (DBusConnection *connection, dbus_bool_t value);
(def-call-out dbus_connection_set_allow_anonymous (:return-type nil)
  (:arguments (connection DBusConnection*) (value dbus_bool_t)))

;; void dbus_connection_set_route_peer_messages (DBusConnection *connection, dbus_bool_t value);
(def-call-out dbus_connection_set_route_peer_messages (:return-type nil)
  (:arguments (connection DBusConnection*) (value dbus_bool_t)))



;; Filters

;; dbus_bool_t dbus_connection_add_filter (DBusConnection *connection, DBusHandleMessageFunction function, void *user_data, DBusFreeFunction free_data_function);
(def-call-out dbus_connection_add_filter (:return-type dbus_bool_t)
  (:arguments (connection DBusConnection*) (function DBusHandleMessageFunction)
              (user_data c-pointer) (free_data_function DBusFreeFunction)))

;; void dbus_connection_remove_filter (DBusConnection *connection, DBusHandleMessageFunction function, void *user_data);
(def-call-out dbus_connection_remove_filter (:return-type nil)
  (:arguments (connection DBusConnection*) (function DBusHandleMessageFunction) (user_data c-pointer)))


;; Other
;; dbus_bool_t dbus_connection_allocate_data_slot (dbus_int32_t *slot_p);
(def-call-out dbus_connection_allocate_data_slot (:return-type dbus_bool_t)
  (:arguments (slot_p (c-pointer dbus_int32_t))))

;; void dbus_connection_free_data_slot (dbus_int32_t *slot_p);
(def-call-out dbus_connection_free_data_slot (:return-type nil)
  (:arguments (slot_p (c-pointer dbus_int32_t))))

;; dbus_bool_t dbus_connection_set_data (DBusConnection *connection, dbus_int32_t slot, void *data, DBusFreeFunction free_data_func);
(def-call-out dbus_connection_set_data (:return-type dbus_bool_t)
  (:arguments (connection DBusConnection*) (slot dbus_int32_t) (data c-pointer) (free_data_func DBusFreeFunction)))

;; void* dbus_connection_get_data (DBusConnection *connection, dbus_int32_t slot);
(def-call-out dbus_connection_get_data (:return-type c-pointer)
  (:arguments (connection DBusConnection*) (slot dbus_int32_t)))


;; void dbus_connection_set_change_sigpipe (dbus_bool_t will_modify_sigpipe);
(def-call-out dbus_connection_set_change_sigpipe (:return-type nil)
  (:arguments (will_modify_sigpipe dbus_bool_t)))


;; void dbus_connection_set_max_message_size (DBusConnection *connection, long size);
(def-call-out dbus_connection_set_max_message_size (:return-type nil)
  (:arguments (connection DBusConnection*) (size long)))

;; long dbus_connection_get_max_message_size (DBusConnection *connection);
(def-call-out dbus_connection_get_max_message_size (:return-type long)
  (:arguments (connection DBusConnection*)))

;; void dbus_connection_set_max_received_size (DBusConnection *connection, long size);
(def-call-out dbus_connection_set_max_received_size (:return-type nil)
  (:arguments (connection DBusConnection*) (size long)))

;; long dbus_connection_get_max_received_size (DBusConnection *connection);
(def-call-out dbus_connection_get_max_received_size (:return-type long)
  (:arguments (connection DBusConnection*)))

;; long dbus_connection_get_outgoing_size (DBusConnection *connection);
(def-call-out dbus_connection_get_outgoing_size (:return-type long)
  (:arguments (connection DBusConnection*)))


;; DBusPreallocatedSend* dbus_connection_preallocate_send (DBusConnection *connection);
(def-call-out dbus_connection_preallocate_send (:return-type DBusPreallocatedSend*)
  (:arguments (connection DBusConnection*)))

;; void dbus_connection_free_preallocated_send (DBusConnection *connection, DBusPreallocatedSend *preallocated);
(def-call-out dbus_connection_free_preallocated_send (:return-type nil)
  (:arguments (connection DBusConnection*)
              (preallocated DBusPreallocatedSend*)))

;; void dbus_connection_send_preallocated (DBusConnection *connection, DBusPreallocatedSend *preallocated, DBusMessage *message, dbus_uint32_t *client_serial);
(def-call-out dbus_connection_send_preallocated (:return-type nil)
  (:arguments (connection DBusConnection*) (preallocated DBusPreallocatedSend*)
              (message DBusMessage*)
              (client_serial (c-ptr dbus_uint32_t) :out)))


;; Object tree functionality


;; Called when a #DBusObjectPathVTable is unregistered (or its connection
;; is freed).  Found in #DBusObjectPathVTable.
;; typedef void (* DBusObjectPathUnregisterFunction) (DBusConnection *connection, void *user_data);
(def-c-type DBusObjectPathUnregisterFunction
  (c-function (:return-type nil)
              (:arguments (connection DBusConnection*) (user_data c-pointer))))
(def-c-type DBusObjectPathUnregisterFunction*
  (c-pointer DBusObjectPathUnregisterFunction))


;; Called when a message is sent to a registered object path. Found in
;; #DBusObjectPathVTable which is registered with
;; dbus_connection_register_object_path() or
;; dbus_connection_register_fallback().
;; typedef DBusHandlerResult (* DBusObjectPathMessageFunction) (DBusConnection *connection, DBusMessage *message, void *user_data);
(def-c-type DBusObjectPathMessageFunction
  (c-function (:return-type DBusHandlerResult)
              (:arguments (connection DBusConnection*) (message DBusMessage*)
                          (user_data c-pointer))))
(def-c-type DBusObjectPathMessageFunction*
  (c-pointer DBusObjectPathMessageFunction))



;; Virtual table that must be implemented to handle a portion of the object
;; path hierarchy. Attach the vtable to a particular path using
;; dbus_connection_register_object_path() or
;; dbus_connection_register_fallback().
(def-c-struct DBusObjectPathVTable
  (unregister_function DBusObjectPathUnregisterFunction) ; Function to unregister this handler
  (message_function DBusObjectPathMessageFunction) ; Function to handle messages
  (dbus_internal_pad1 c-pointer) ; Reserved for future expansion
  (dbus_internal_pad2 c-pointer) ; Reserved for future expansion
  (dbus_internal_pad3 c-pointer) ; Reserved for future expansion
  (dbus_internal_pad4 c-pointer) ; Reserved for future expansion
  )

;; dbus_bool_t dbus_connection_try_register_object_path (DBusConnection *connection, const char *path, const DBusObjectPathVTable *vtable, void *user_data, DBusError *error);
(def-call-out dbus_connection_try_register_object_path (:return-type dbus_bool_t)
  (:arguments (connection DBusConnection*) (path c-string)
              (vtable DBusObjectPathVTable*) (user_data c-pointer)
              (error (c-pointer DBusError))))

;; dbus_bool_t dbus_connection_register_object_path (DBusConnection *connection, const char *path, const DBusObjectPathVTable *vtable, void *user_data);
(def-call-out dbus_connection_register_object_path (:return-type dbus_bool_t)
  (:arguments (connection DBusConnection*) (path c-string)
              (vtable DBusObjectPathVTable*) (user_data c-pointer)))

;; dbus_bool_t dbus_connection_try_register_fallback (DBusConnection *connection, const char *path, const DBusObjectPathVTable *vtable, void *user_data, DBusError *error);
(def-call-out dbus_connection_try_register_fallback (:return-type dbus_bool_t)
  (:arguments (connection DBusConnection*) (path c-string)
              (vtable DBusObjectPathVTable*) (user_data c-pointer)
              (error (c-pointer DBusError))))

;; dbus_bool_t dbus_connection_register_fallback (DBusConnection *connection, const char *path, const DBusObjectPathVTable *vtable, void *user_data);
(def-call-out dbus_connection_register_fallback (:return-type dbus_bool_t)
  (:arguments (connection DBusConnection*) (path c-string)
              (vtable DBusObjectPathVTable*) (user_data c-pointer)))

;; dbus_bool_t dbus_connection_unregister_object_path (DBusConnection *connection, const char *path);
(def-call-out dbus_connection_unregister_object_path (:return-type dbus_bool_t)
  (:arguments (connection DBusConnection*) (path c-string)))


;; dbus_bool_t dbus_connection_get_object_path_data (DBusConnection *connection, const char *path, void **data_p);
(def-call-out dbus_connection_get_object_path_data (:return-type dbus_bool_t)
  (:arguments (connection DBusConnection*) (path c-string)
              (data_p (c-ptr c-pointer) :out)))


;; dbus_bool_t dbus_connection_list_registered (DBusConnection *connection, const char *parent_path, char ***child_entries);
(def-call-out dbus_connection_list_registered (:return-type dbus_bool_t)
  (:arguments (connection DBusConnection*) (parent_path c-string)
              (child_entries (c-ptr (c-array-ptr c-string)) :out)))

;;  dbus_bool_t dbus_connection_get_unix_fd (DBusConnection *connection, int *fd);
(def-call-out dbus_connection_get_unix_fd (:return-type dbus_bool_t)
  (:arguments (connection DBusConnection*) (fd (c-ptr int) :out)))

;; dbus_bool_t dbus_connection_get_socket (DBusConnection *connection, int *fd);
(def-call-out dbus_connection_get_socket (:return-type dbus_bool_t)
  (:arguments (connection DBusConnection*) (fd (c-ptr int) :out)))


;; [removed in 1.2.1] char* dbus_get_local_machine_id (void);
(def-call-out dbus_get_local_machine_id (:return-type c-string)
  (:arguments))

;; [deprecated in 1.2.1] int dbus_watch_get_fd (DBusWatch *watch);
(def-call-out dbus_watch_get_fd (:return-type int)
  (:arguments (watch DBusWatch*)))

;; int dbus_watch_get_unix_fd (DBusWatch *watch);
(def-call-out dbus_watch_get_unix_fd (:return-type int)
  (:arguments (watch DBusWatch*)))

;; int dbus_watch_get_socket (DBusWatch *watch);
(def-call-out dbus_watch_get_socket (:return-type int)
  (:arguments (watch DBusWatch*)))

;; unsigned int dbus_watch_get_flags (DBusWatch *watch);
(def-call-out dbus_watch_get_flags (:return-type uint)
  (:arguments (watch DBusWatch*)))

;; void* dbus_watch_get_data (DBusWatch *watch);
(def-call-out dbus_watch_get_data (:return-type c-pointer)
  (:arguments (watch DBusWatch*)))

;; void dbus_watch_set_data (DBusWatch *watch, void *data, DBusFreeFunction free_data_function);
(def-call-out dbus_watch_set_data (:return-type nil)
  (:arguments (watch DBusWatch*) (data c-pointer)
              (free_data_function DBusFreeFunction)))

;; dbus_bool_t dbus_watch_handle (DBusWatch *watch, unsigned int flags);
(def-call-out dbus_watch_handle (:return-type dbus_bool_t)
  (:arguments (watch DBusWatch*) (flags uint)))

;; dbus_bool_t dbus_watch_get_enabled (DBusWatch *watch);
(def-call-out dbus_watch_get_enabled (:return-type dbus_bool_t)
  (:arguments (watch DBusWatch*)))



;; int dbus_timeout_get_interval (DBusTimeout *timeout);
(def-call-out dbus_timeout_get_interval (:return-type int)
  (:arguments (timeout DBusTimeout*)))

;; void* dbus_timeout_get_data (DBusTimeout *timeout);
(def-call-out dbus_timeout_get_data (:return-type c-pointer)
  (:arguments (timeout DBusTimeout*)))

;; void dbus_timeout_set_data (DBusTimeout *timeout, void *data, DBusFreeFunction free_data_function);
(def-call-out dbus_timeout_set_data (:return-type nil)
  (:arguments (timeout DBusTimeout*) (data c-pointer)
              (free_data_function DBusFreeFunction)))

;; dbus_bool_t dbus_timeout_handle (DBusTimeout *timeout);
(def-call-out dbus_timeout_handle (:return-type dbus_bool_t)
  (:arguments (timeout DBusTimeout*)))

;; dbus_bool_t dbus_timeout_get_enabled (DBusTimeout *timeout);
(def-call-out dbus_timeout_get_enabled (:return-type dbus_bool_t)
  (:arguments (timeout DBusTimeout*)))


;; === dbus-bus.h

;; DBusConnection *dbus_bus_get (DBusBusType type, DBusError *error);
(def-call-out dbus_bus_get (:return-type DBusConnection*)
  (:arguments (type DBusBusType) (error (c-pointer DBusError))))

;; DBusConnection *dbus_bus_get_private (DBusBusType type, DBusError *error);
(def-call-out dbus_bus_get_private (:return-type DBusConnection*)
  (:arguments (type DBusBusType) (error (c-pointer DBusError))))


;; dbus_bool_t dbus_bus_register (DBusConnection *connection, DBusError *error);
(def-call-out dbus_bus_register (:return-type dbus_bool_t)
  (:arguments (connection DBusConnection*) (error (c-pointer DBusError))))

;; dbus_bool_t dbus_bus_set_unique_name (DBusConnection *connection, const char *unique_name);
(def-call-out dbus_bus_set_unique_name (:return-type dbus_bool_t)
  (:arguments (connection DBusConnection*) (unique_name c-string)))

;; const char* dbus_bus_get_unique_name (DBusConnection *connection);
(def-call-out dbus_bus_get_unique_name (:return-type c-string)
  (:arguments (connection DBusConnection*)))

;; unsigned long dbus_bus_get_unix_user (DBusConnection *connection, const char *name, DBusError *error);
(def-call-out dbus_bus_get_unix_user (:return-type ulong)
  (:arguments (connection DBusConnection*) (name c-string)
              (error (c-pointer DBusError))))

;; char* dbus_bus_get_id (DBusConnection *connection, DBusError *error);
(def-call-out dbus_bus_get_id (:return-type c-string)
  (:arguments (connection DBusConnection*) (error (c-pointer DBusError))))

;; int dbus_bus_request_name (DBusConnection *connection, const char *name, unsigned int flags, DBusError *error);
(def-call-out dbus_bus_request_name (:return-type int)
  (:arguments (connection DBusConnection*) (name c-string)
              (flags uint) (error (c-pointer DBusError))))

;; int dbus_bus_release_name (DBusConnection *connection, const char *name, DBusError *error);
(def-call-out dbus_bus_release_name (:return-type int)
  (:arguments (connection DBusConnection*) (name c-string)
              (error (c-pointer DBusError))))

;; dbus_bool_t dbus_bus_name_has_owner (DBusConnection *connection, const char *name, DBusError *error);
(def-call-out dbus_bus_name_has_owner (:return-type dbus_bool_t)
  (:arguments (connection DBusConnection*) (name c-string)
              (error (c-pointer DBusError))))


;; dbus_bool_t dbus_bus_start_service_by_name (DBusConnection *connection, const char *name, dbus_uint32_t flags, dbus_uint32_t *reply, DBusError *error);
(def-call-out dbus_bus_start_service_by_name (:return-type dbus_bool_t)
  (:arguments (connection DBusConnection*) (name c-string)
              (flags dbus_uint32_t) (reply (c-ptr dbus_uint32_t) :out)
              (error (c-pointer DBusError))))


;; void dbus_bus_add_match (DBusConnection *connection, const char *rule, DBusError *error);
(def-call-out dbus_bus_add_match (:return-type nil)
  (:arguments (connection DBusConnection*) (rule c-string)
              (error (c-pointer DBusError))))

;; void dbus_bus_remove_match (DBusConnection *connection, const char *rule, DBusError *error);
(def-call-out dbus_bus_remove_match (:return-type nil)
  (:arguments (connection DBusConnection*) (rule c-string)
              (error (c-pointer DBusError))))


;; === dbus-pending-call.h

;; DBusPendingCall* dbus_pending_call_ref (DBusPendingCall *pending);
(def-call-out dbus_pending_call_ref (:return-type DBusPendingCall*)
  (:arguments (pending DBusPendingCall*)))

;; void dbus_pending_call_unref (DBusPendingCall *pending);
(def-call-out dbus_pending_call_unref (:return-type nil)
  (:arguments (pending DBusPendingCall*)))

;; dbus_bool_t dbus_pending_call_set_notify (DBusPendingCall *pending, DBusPendingCallNotifyFunction function, void *user_data, DBusFreeFunction free_user_data);
(def-call-out dbus_pending_call_set_notify (:return-type dbus_bool_t)
  (:arguments (pending DBusPendingCall*)
              (function DBusPendingCallNotifyFunction)
              (user_data c-pointer) (free_user_data DBusFreeFunction)))

;; void dbus_pending_call_cancel (DBusPendingCall *pending);
(def-call-out dbus_pending_call_cancel (:return-type nil)
  (:arguments (pending DBusPendingCall*)))

;; dbus_bool_t dbus_pending_call_get_completed (DBusPendingCall *pending);
(def-call-out dbus_pending_call_get_completed (:return-type dbus_bool_t)
  (:arguments (pending DBusPendingCall*)))

;; DBusMessage* dbus_pending_call_steal_reply (DBusPendingCall *pending);
(def-call-out dbus_pending_call_steal_reply (:return-type DBusMessage*)
  (:arguments (pending DBusPendingCall*)))

;; void dbus_pending_call_block (DBusPendingCall *pending);
(def-call-out dbus_pending_call_block (:return-type nil)
  (:arguments (pending DBusPendingCall*)))


;; dbus_bool_t dbus_pending_call_allocate_data_slot (dbus_int32_t *slot_p);
(def-call-out dbus_pending_call_allocate_data_slot (:return-type dbus_bool_t)
  (:arguments (slot_p (c-pointer dbus_int32_t))))

;; void dbus_pending_call_free_data_slot (dbus_int32_t *slot_p);
(def-call-out dbus_pending_call_free_data_slot (:return-type nil)
  (:arguments (slot_p (c-pointer dbus_int32_t))))

;; dbus_bool_t dbus_pending_call_set_data (DBusPendingCall *pending, dbus_int32_t slot, void *data, DBusFreeFunction free_data_func);
(def-call-out dbus_pending_call_set_data (:return-type dbus_bool_t)
  (:arguments (pending DBusPendingCall*) (slot dbus_int32_t)
              (data c-pointer) (free_data_func DBusFreeFunction)))

;; void* dbus_pending_call_get_data (DBusPendingCall *pending, dbus_int32_t slot);
(def-call-out dbus_pending_call_get_data (:return-type c-pointer)
  (:arguments (pending DBusPendingCall*) (slot dbus_int32_t)))


;; === dbus-protocol.h

;; Message byte order
(def-c-const DBUS_LITTLE_ENDIAN ; ('l')
  (:documentation "Code marking LSB-first byte order in the wire protocol."))
(def-c-const DBUS_BIG_ENDIAN ; ('B')
  (:documentation "Code marking MSB-first byte order in the wire protocol."))

(def-c-const DBUS_MAJOR_PROTOCOL_VERSION ; 1
  (:documentation "Protocol version."))

(def-c-const DBUS_TYPE_INVALID ; ((int) '\0')
  (:documentation "Type code that is never equal to a legitimate type code"))
(def-c-const DBUS_TYPE_INVALID_AS_STRING (:type c-string) ; "\0"
  (:documentation "#DBUS_TYPE_INVALID as a string literal instead of a int literal"))

;; Primitive types
(def-c-const DBUS_TYPE_BYTE ; ((int) 'y')
  (:documentation "Type code marking an 8-bit unsigned integer"))
(def-c-const DBUS_TYPE_BYTE_AS_STRING (:type c-string) ; "y"
  (:documentation "#DBUS_TYPE_BYTE as a string literal instead of a int literal"))
(def-c-const DBUS_TYPE_BOOLEAN ; ((int) 'b')
  (:documentation "Type code marking a boolean"))
(def-c-const DBUS_TYPE_BOOLEAN_AS_STRING (:type c-string) ; "b"
  (:documentation "#DBUS_TYPE_BOOLEAN as a string literal instead of a int literal"))
(def-c-const DBUS_TYPE_INT16 ; ((int) 'n')
  (:documentation "Type code marking a 16-bit signed integer"))
(def-c-const DBUS_TYPE_INT16_AS_STRING (:type c-string) ; "n"
  (:documentation "#DBUS_TYPE_INT16 as a string literal instead of a int literal"))
(def-c-const DBUS_TYPE_UINT16 ; ((int) 'q')
  (:documentation "Type code marking a 16-bit unsigned integer"))
(def-c-const DBUS_TYPE_UINT16_AS_STRING (:type c-string) ; "q"
  (:documentation "#DBUS_TYPE_UINT16 as a string literal instead of a int literal"))
(def-c-const DBUS_TYPE_INT32 ; ((int) 'i')
  (:documentation "Type code marking a 32-bit signed integer"))
(def-c-const DBUS_TYPE_INT32_AS_STRING (:type c-string) ; "i"
  (:documentation "#DBUS_TYPE_INT32 as a string literal instead of a int literal"))
(def-c-const DBUS_TYPE_UINT32 ; ((int) 'u')
  (:documentation "Type code marking a 32-bit unsigned integer"))
(def-c-const DBUS_TYPE_UINT32_AS_STRING (:type c-string) ; "u"
  (:documentation "#DBUS_TYPE_UINT32 as a string literal instead of a int literal"))
(def-c-const DBUS_TYPE_INT64 ; ((int) 'x')
  (:documentation "Type code marking a 64-bit signed integer"))
(def-c-const DBUS_TYPE_INT64_AS_STRING (:type c-string) ; "x"
  (:documentation "#DBUS_TYPE_INT64 as a string literal instead of a int literal"))
(def-c-const DBUS_TYPE_UINT64 ; ((int) 't')
  (:documentation "Type code marking a 64-bit unsigned integer"))
(def-c-const DBUS_TYPE_UINT64_AS_STRING (:type c-string) ; "t"
  (:documentation "#DBUS_TYPE_UINT64 as a string literal instead of a int literal"))
(def-c-const DBUS_TYPE_DOUBLE ; ((int) 'd')
  (:documentation "Type code marking an 8-byte double in IEEE 754 format"))
(def-c-const DBUS_TYPE_DOUBLE_AS_STRING (:type c-string) ; "d"
  (:documentation "#DBUS_TYPE_DOUBLE as a string literal instead of a int literal"))
(def-c-const DBUS_TYPE_STRING ; ((int) 's')
  (:documentation "Type code marking a UTF-8 encoded, nul-terminated Unicode string"))
(def-c-const DBUS_TYPE_STRING_AS_STRING (:type c-string) ; "s"
  (:documentation "#DBUS_TYPE_STRING as a string literal instead of a int literal"))
(def-c-const DBUS_TYPE_OBJECT_PATH ; ((int) 'o')
  (:documentation "Type code marking a D-Bus object path"))
(def-c-const DBUS_TYPE_OBJECT_PATH_AS_STRING (:type c-string) ; "o"
  (:documentation "#DBUS_TYPE_OBJECT_PATH as a string literal instead of a int literal"))
(def-c-const DBUS_TYPE_SIGNATURE ; ((int) 'g')
  (:documentation "Type code marking a D-Bus type signature"))
(def-c-const DBUS_TYPE_SIGNATURE_AS_STRING (:type c-string) ; "g"
  (:documentation "#DBUS_TYPE_SIGNATURE as a string literal instead of a int literal"))

;; Compound types
(def-c-const DBUS_TYPE_ARRAY ; ((int) 'a')
  (:documentation "Type code marking a D-Bus array type"))
(def-c-const DBUS_TYPE_ARRAY_AS_STRING (:type c-string) ; "a"
  (:documentation "#DBUS_TYPE_ARRAY as a string literal instead of a int literal"))
(def-c-const DBUS_TYPE_VARIANT ; ((int) 'v')
  (:documentation "Type code marking a D-Bus variant type"))
(def-c-const DBUS_TYPE_VARIANT_AS_STRING (:type c-string) ; "v"
  (:documentation "#DBUS_TYPE_VARIANT as a string literal instead of a int literal"))

;; STRUCT and DICT_ENTRY are sort of special since their codes can't appear
;; in a type string, instead
;; DBUS_STRUCT_BEGIN_CHAR/DBUS_DICT_ENTRY_BEGIN_CHAR have to appear
(def-c-const DBUS_TYPE_STRUCT ; ((int) 'r')
  (:documentation "Type code used to represent a struct;
however, this type code does not appear in type signatures,
instead #DBUS_STRUCT_BEGIN_CHAR and #DBUS_STRUCT_END_CHAR
will appear in a signature."))
(def-c-const DBUS_TYPE_STRUCT_AS_STRING (:type c-string) ; "r"
  (:documentation "#DBUS_TYPE_STRUCT as a string literal instead of a int literal"))
(def-c-const DBUS_TYPE_DICT_ENTRY ; ((int) 'e')
  (:documentation "Type code used to represent a dict entry; \
however, this type code does not appear in type signatures,
instead #DBUS_DICT_ENTRY_BEGIN_CHAR and #DBUS_DICT_ENTRY_END_CHAR
will appear in a signature."))
(def-c-const DBUS_TYPE_DICT_ENTRY_AS_STRING (:type c-string) ; "e"
  (:documentation "#DBUS_TYPE_DICT_ENTRY as a string literal instead of a int literal"))

(def-c-const DBUS_NUMBER_OF_TYPES ; (16)
  (:documentation "Does not include #DBUS_TYPE_INVALID, #DBUS_STRUCT_BEGIN_CHAR,
#DBUS_STRUCT_END_CHAR, #DBUS_DICT_ENTRY_BEGIN_CHAR, or #DBUS_DICT_ENTRY_END_CHAR
i.e. it is the number of valid types, not the number of distinct
characters that may appear in a type signature."))

;; characters other than typecodes that appear in type signatures

(def-c-const DBUS_STRUCT_BEGIN_CHAR ; ((int) '(')
  (:documentation "Code marking the start of a struct type in a type signature"))
(def-c-const DBUS_STRUCT_BEGIN_CHAR_AS_STRING (:type c-string) ; "("
  (:documentation "#DBUS_STRUCT_BEGIN_CHAR as a string literal instead of a int literal"))
(def-c-const DBUS_STRUCT_END_CHAR ; ((int) ')')
  (:documentation "Code marking the end of a struct type in a type signature"))
(def-c-const DBUS_STRUCT_END_CHAR_AS_STRING (:type c-string) ; ")"
  (:documentation "#DBUS_STRUCT_END_CHAR a string literal instead of a int literal"))
(def-c-const DBUS_DICT_ENTRY_BEGIN_CHAR ; ((int) '{')
  (:documentation "Code marking the start of a dict entry type in a type signature"))
(def-c-const DBUS_DICT_ENTRY_BEGIN_CHAR_AS_STRING (:type c-string) ; "{"
  (:documentation "#DBUS_DICT_ENTRY_BEGIN_CHAR as a string literal instead of a int literal"))
(def-c-const DBUS_DICT_ENTRY_END_CHAR ; ((int) '}')
  (:documentation "Code marking the end of a dict entry type in a type signature"))
(def-c-const DBUS_DICT_ENTRY_END_CHAR_AS_STRING (:type c-string) ; "}"
  (:documentation "#DBUS_DICT_ENTRY_END_CHAR as a string literal instead of a int literal"))


(def-c-const DBUS_MAXIMUM_NAME_LENGTH ; 255
  (:documentation "Max length in bytes of a bus name, interface,
or member (not object path, paths are unlimited).
This is limited because lots of stuff is O(n) in this number,
plus it would be obnoxious to type in a paragraph-long method name
so most likely something like that would be an exploit."))

(def-c-const DBUS_MAXIMUM_SIGNATURE_LENGTH ; 255
  (:documentation "This one is 255 so it fits in a byte"))

(def-c-const DBUS_MAXIMUM_MATCH_RULE_LENGTH ; 1024
  (:documentation "Max length of a match rule string;
to keep people from hosing the daemon with some huge rule"))

(def-c-const DBUS_MAXIMUM_MATCH_RULE_ARG_NUMBER ; 63
  (:documentation "Max arg number you can match on in a match rule,
e.g. arg0='hello' is OK, arg3489720987='hello' is not"))

(def-c-const DBUS_MAXIMUM_ARRAY_LENGTH ; (67108864)
  (:documentation "Max length of a marshaled array in bytes (64M, 2^26)
We use signed int for lengths so must be INT_MAX or less.
We need something a bit smaller than INT_MAX because the array is inside
a message with header info, etc.  so an INT_MAX array wouldn't allow
the message overhead.  The 64M number is an attempt at a larger number than
we'd reasonably ever use, but small enough that your bus would chew
through it fairly quickly without locking up forever. If you have
data that's likely to be larger than this, you should probably be
sending it in multiple incremental messages anyhow."))
(def-c-const DBUS_MAXIMUM_ARRAY_LENGTH_BITS ; 26
  (:documentation "Number of bits you need in an unsigned to store the max array size"))

(def-c-const DBUS_MAXIMUM_MESSAGE_LENGTH ; (DBUS_MAXIMUM_ARRAY_LENGTH * 2)
  (:documentation "The maximum total message size including header and body;
similar rationale to max array size."))
(def-c-const DBUS_MAXIMUM_MESSAGE_LENGTH_BITS ; 27
  (:documentation "Number of bits you need in an unsigned to store the max message size"))

(def-c-const DBUS_MAXIMUM_TYPE_RECURSION_DEPTH ; 32
  (:documentation "Depth of recursion in the type tree.
This is automatically limited to DBUS_MAXIMUM_SIGNATURE_LENGTH since
you could only have an array of array of array of ...
that fit in the max signature.  But that's probably a bit too large."))

;; Types of message

(def-c-const DBUS_MESSAGE_TYPE_INVALID ; 0
  (:documentation "This value is never a valid message type, see dbus_message_get_type()"))
(def-c-const DBUS_MESSAGE_TYPE_METHOD_CALL ; 1
  (:documentation "Message type of a method call message, see dbus_message_get_type()"))
(def-c-const DBUS_MESSAGE_TYPE_METHOD_RETURN ; 2
  (:documentation "Message type of a method return message, see dbus_message_get_type()"))
(def-c-const DBUS_MESSAGE_TYPE_ERROR ; 3
  (:documentation "Message type of an error reply message, see dbus_message_get_type()"))
(def-c-const DBUS_MESSAGE_TYPE_SIGNAL ; 4
  (:documentation "Message type of a signal message, see dbus_message_get_type()"))

;; Header flags

(def-c-const DBUS_HEADER_FLAG_NO_REPLY_EXPECTED ; 0x1
  (:documentation "If set, this flag means that the sender of a message
does not care about getting a reply, so the recipient need not send one.
See dbus_message_set_no_reply()."))
(def-c-const DBUS_HEADER_FLAG_NO_AUTO_START ; 0x2
  (:documentation "If set, this flag means that even if the message bus
knows how to start an owner for the destination bus name (see
dbus_message_set_destination()), it should not do so. If this flag is
not set, the bus may launch a program to process the message."))

;; Header fields

(def-c-const DBUS_HEADER_FIELD_INVALID ; 0
  (:documentation "Not equal to any valid header field code"))
(def-c-const DBUS_HEADER_FIELD_PATH ; 1
  (:documentation "Header field code for the path - the path is the
object emitting a signal or the object receiving a method call.
See dbus_message_set_path()."))
(def-c-const DBUS_HEADER_FIELD_INTERFACE ; 2
  (:documentation "Header field code for the interface containing a
member (method or signal).  See dbus_message_set_interface()."))
(def-c-const DBUS_HEADER_FIELD_MEMBER ; 3
  (:documentation "Header field code for a member (method or signal).
See dbus_message_set_member()."))
(def-c-const DBUS_HEADER_FIELD_ERROR_NAME ; 4
  (:documentation "Header field code for an error name (found in #DBUS_MESSAGE_TYPE_ERROR messages).
See dbus_message_set_error_name()."))
(def-c-const DBUS_HEADER_FIELD_REPLY_SERIAL ; 5
  (:documentation "Header field code for a reply serial, used to match a #DBUS_MESSAGE_TYPE_METHOD_RETURN message with the
message that it's a reply to. See dbus_message_set_reply_serial()."))
(def-c-const DBUS_HEADER_FIELD_DESTINATION ; 6
  (:documentation "Header field code for the destination bus name of a message. See dbus_message_set_destination()."))
(def-c-const DBUS_HEADER_FIELD_SENDER ; 7
  (:documentation "Header field code for the sender of a message; usually initialized by the message bus.
See dbus_message_set_sender()."))
(def-c-const DBUS_HEADER_FIELD_SIGNATURE ; 8
  (:documentation "Header field code for the type signature of a message."))

(def-c-const DBUS_HEADER_FIELD_LAST ; DBUS_HEADER_FIELD_SIGNATURE
  (:documentation "Value of the highest-numbered header field code,
can be used to determine the size of an array indexed by header field code.
Remember though that unknown codes must be ignored,
so check for that before indexing the array."))

(def-c-const DBUS_HEADER_SIGNATURE (:type c-string)
    ;; DBUS_TYPE_BYTE_AS_STRING
    ;; DBUS_TYPE_BYTE_AS_STRING
    ;; DBUS_TYPE_BYTE_AS_STRING
    ;; DBUS_TYPE_BYTE_AS_STRING
    ;; DBUS_TYPE_UINT32_AS_STRING
    ;; DBUS_TYPE_UINT32_AS_STRING
    ;; DBUS_TYPE_ARRAY_AS_STRING
    ;; DBUS_STRUCT_BEGIN_CHAR_AS_STRING
    ;; DBUS_TYPE_BYTE_AS_STRING
    ;; DBUS_TYPE_VARIANT_AS_STRING
    ;; DBUS_STRUCT_END_CHAR_AS_STRING
  (:documentation "Header format is defined as a signature:
byte                            byte order
byte                            message type ID
byte                            flags
byte                            protocol version
uint32                          body length
uint32                          serial
array of struct (byte,variant)  (field name, value)

The length of the header can be computed as the
fixed size of the initial data, plus the length of
the array at the end, plus padding to an 8-boundary."))

(def-c-const DBUS_MINIMUM_HEADER_SIZE ; 16
  (:documentation "The smallest header size that can occur.
\(It won't be valid due to missing required header fields.)
This is 4 bytes, two uint32, an array length.
This isn't any kind of resource limit, just the
necessary/logical outcome of the header signature."))

;; Errors
;; WARNING these get autoconverted to an enum in dbus-glib.h.
;; Thus, if you change the order it breaks the ABI. Keep them in order.
;; Also, don't change the formatting since that will break the sed script.

(def-c-const DBUS_ERROR_FAILED (:type c-string) ; "org.freedesktop.DBus.Error.Failed"
  (:documentation "A generic error; \"something went wrong\" - see the error message for more."))
(def-c-const DBUS_ERROR_NO_MEMORY (:type c-string) ; "org.freedesktop.DBus.Error.NoMemory"
  (:documentation "There was not enough memory to complete an operation."))
(def-c-const DBUS_ERROR_SERVICE_UNKNOWN (:type c-string) ; "org.freedesktop.DBus.Error.ServiceUnknown"
  (:documentation "The bus doesn't know how to launch a service to supply the bus name you wanted."))
(def-c-const DBUS_ERROR_NAME_HAS_NO_OWNER (:type c-string) ; "org.freedesktop.DBus.Error.NameHasNoOwner"
  (:documentation "The bus name you referenced doesn't exist (i.e. no application owns it)."))
(def-c-const DBUS_ERROR_NO_REPLY (:type c-string) ; "org.freedesktop.DBus.Error.NoReply"
  (:documentation "No reply to a message expecting one, usually means a timeout occurred."))
(def-c-const DBUS_ERROR_IO_ERROR (:type c-string) ; "org.freedesktop.DBus.Error.IOError"
  (:documentation "Something went wrong reading or writing to a socket, for example."))
(def-c-const DBUS_ERROR_BAD_ADDRESS (:type c-string) ; "org.freedesktop.DBus.Error.BadAddress"
  (:documentation "A D-Bus bus address was malformed."))
(def-c-const DBUS_ERROR_NOT_SUPPORTED (:type c-string) ; "org.freedesktop.DBus.Error.NotSupported"
  (:documentation "Requested operation isn't supported (like ENOSYS on UNIX)."))
(def-c-const DBUS_ERROR_LIMITS_EXCEEDED (:type c-string) ; "org.freedesktop.DBus.Error.LimitsExceeded"
  (:documentation "Some limited resource is exhausted."))
(def-c-const DBUS_ERROR_ACCESS_DENIED (:type c-string) ; "org.freedesktop.DBus.Error.AccessDenied"
  (:documentation "Security restrictions don't allow doing what you're trying to do."))
(def-c-const DBUS_ERROR_AUTH_FAILED (:type c-string) ; "org.freedesktop.DBus.Error.AuthFailed"
  (:documentation "Authentication didn't work."))
(def-c-const DBUS_ERROR_NO_SERVER (:type c-string) ; "org.freedesktop.DBus.Error.NoServer"
  (:documentation "Unable to connect to server (probably caused by ECONNREFUSED on a socket)."))
(def-c-const DBUS_ERROR_TIMEOUT (:type c-string) ; "org.freedesktop.DBus.Error.Timeout"
  (:documentation "Certain timeout errors, possibly ETIMEDOUT on a socket.
Note that #DBUS_ERROR_NO_REPLY is used for message reply timeouts.
@warning this is confusingly-named given that #DBUS_ERROR_TIMED_OUT also exists.
We can't fix it for compatibility reasons so just be careful."))
(def-c-const DBUS_ERROR_NO_NETWORK (:type c-string) ; "org.freedesktop.DBus.Error.NoNetwork"
  (:documentation "No network access (probably ENETUNREACH on a socket)."))
(def-c-const DBUS_ERROR_ADDRESS_IN_USE (:type c-string) ; "org.freedesktop.DBus.Error.AddressInUse"
  (:documentation "Can't bind a socket since its address is in use (i.e. EADDRINUSE)."))
(def-c-const DBUS_ERROR_DISCONNECTED (:type c-string) ; "org.freedesktop.DBus.Error.Disconnected"
  (:documentation "The connection is disconnected and you're trying to use it."))
(def-c-const DBUS_ERROR_INVALID_ARGS (:type c-string) ; "org.freedesktop.DBus.Error.InvalidArgs"
  (:documentation "Invalid arguments passed to a method call."))
(def-c-const DBUS_ERROR_FILE_NOT_FOUND (:type c-string) ; "org.freedesktop.DBus.Error.FileNotFound"
  (:documentation "Missing file."))
(def-c-const DBUS_ERROR_FILE_EXISTS (:type c-string) ; "org.freedesktop.DBus.Error.FileExists"
  (:documentation "Existing file and the operation you're using does not silently overwrite."))
(def-c-const DBUS_ERROR_UNKNOWN_METHOD (:type c-string) ; "org.freedesktop.DBus.Error.UnknownMethod"
  (:documentation "Method name you invoked isn't known by the object you invoked it on."))
(def-c-const DBUS_ERROR_TIMED_OUT (:type c-string) ; "org.freedesktop.DBus.Error.TimedOut"
  (:documentation "Certain timeout errors, e.g. while starting a service.
@warning this is confusingly-named given that #DBUS_ERROR_TIMEOUT also exists.
We can't fix it for compatibility reasons so just be careful."))
(def-c-const DBUS_ERROR_MATCH_RULE_NOT_FOUND (:type c-string) ; "org.freedesktop.DBus.Error.MatchRuleNotFound"
  (:documentation "Tried to remove or modify a match rule that didn't exist."))
(def-c-const DBUS_ERROR_MATCH_RULE_INVALID (:type c-string) ; "org.freedesktop.DBus.Error.MatchRuleInvalid"
  (:documentation "The match rule isn't syntactically valid."))
(def-c-const DBUS_ERROR_SPAWN_EXEC_FAILED (:type c-string) ; "org.freedesktop.DBus.Error.Spawn.ExecFailed"
  (:documentation "While starting a new process, the exec() call failed."))
(def-c-const DBUS_ERROR_SPAWN_FORK_FAILED (:type c-string) ; "org.freedesktop.DBus.Error.Spawn.ForkFailed"
  (:documentation "While starting a new process, the fork() call failed."))
(def-c-const DBUS_ERROR_SPAWN_CHILD_EXITED (:type c-string) ; "org.freedesktop.DBus.Error.Spawn.ChildExited"
  (:documentation "While starting a new process, the child exited with a status code."))
(def-c-const DBUS_ERROR_SPAWN_CHILD_SIGNALED (:type c-string) ; "org.freedesktop.DBus.Error.Spawn.ChildSignaled"
  (:documentation "While starting a new process, the child exited on a signal."))
(def-c-const DBUS_ERROR_SPAWN_FAILED (:type c-string) ; "org.freedesktop.DBus.Error.Spawn.Failed"
  (:documentation "While starting a new process, something went wrong."))
(def-c-const DBUS_ERROR_SPAWN_SETUP_FAILED (:type c-string) ; "org.freedesktop.DBus.Error.Spawn.FailedToSetup"
  (:documentation "We failed to setup the environment correctly."))
(def-c-const DBUS_ERROR_SPAWN_CONFIG_INVALID (:type c-string) ; "org.freedesktop.DBus.Error.Spawn.ConfigInvalid"
  (:documentation "We failed to setup the config parser correctly."))
(def-c-const DBUS_ERROR_SPAWN_SERVICE_INVALID (:type c-string) ; "org.freedesktop.DBus.Error.Spawn.ServiceNotValid"
  (:documentation "Bus name was not valid."))
(def-c-const DBUS_ERROR_SPAWN_SERVICE_NOT_FOUND (:type c-string) ; "org.freedesktop.DBus.Error.Spawn.ServiceNotFound"
  (:documentation "Service file not found in system-services directory."))
(def-c-const DBUS_ERROR_SPAWN_PERMISSIONS_INVALID (:type c-string) ; "org.freedesktop.DBus.Error.Spawn.PermissionsInvalid"
  (:documentation "Permissions are incorrect on the setuid helper."))
(def-c-const DBUS_ERROR_SPAWN_FILE_INVALID (:type c-string) ; "org.freedesktop.DBus.Error.Spawn.FileInvalid"
  (:documentation "Service file invalid (Name, User or Exec missing)."))
(def-c-const DBUS_ERROR_SPAWN_NO_MEMORY (:type c-string) ; "org.freedesktop.DBus.Error.Spawn.NoMemory"
  (:documentation "Tried to get a UNIX process ID and it wasn't available."))
(def-c-const DBUS_ERROR_UNIX_PROCESS_ID_UNKNOWN (:type c-string) ; "org.freedesktop.DBus.Error.UnixProcessIdUnknown"
  (:documentation "Tried to get a UNIX process ID and it wasn't available."))
(def-c-const DBUS_ERROR_INVALID_SIGNATURE (:type c-string) ; "org.freedesktop.DBus.Error.InvalidSignature"
  (:documentation "A type signature is not valid."))
(def-c-const DBUS_ERROR_INVALID_FILE_CONTENT (:type c-string) ; "org.freedesktop.DBus.Error.InvalidFileContent"
  (:documentation "A file contains invalid syntax or is otherwise broken."))
(def-c-const DBUS_ERROR_SELINUX_SECURITY_CONTEXT_UNKNOWN (:type c-string) ; "org.freedesktop.DBus.Error.SELinuxSecurityContextUnknown"
  (:documentation "Asked for SELinux security context and it wasn't available."))
(def-c-const DBUS_ERROR_ADT_AUDIT_DATA_UNKNOWN (:type c-string) ; "org.freedesktop.DBus.Error.AdtAuditDataUnknown"
  (:documentation "Asked for ADT audit data and it wasn't available."))
(def-c-const DBUS_ERROR_OBJECT_PATH_IN_USE (:type c-string) ; "org.freedesktop.DBus.Error.ObjectPathInUse"
  (:documentation "There's already an object with the requested object path."))

;; XML introspection format

(def-c-const DBUS_INTROSPECT_1_0_XML_NAMESPACE (:type c-string) ; "http://www.freedesktop.org/standards/dbus"
  (:documentation "XML namespace of the introspection format version 1.0"))
(def-c-const DBUS_INTROSPECT_1_0_XML_PUBLIC_IDENTIFIER (:type c-string) ; "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
  (:documentation "XML public identifier of the introspection format version 1.0"))
(def-c-const DBUS_INTROSPECT_1_0_XML_SYSTEM_IDENTIFIER (:type c-string) ; "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd"
  (:documentation "XML system identifier of the introspection format version 1.0"))
(def-c-const DBUS_INTROSPECT_1_0_XML_DOCTYPE_DECL_NODE (:type c-string) ; "<!DOCTYPE node PUBLIC \""DBUS_INTROSPECT_1_0_XML_PUBLIC_IDENTIFIER"\"\n\""DBUS_INTROSPECT_1_0_XML_SYSTEM_IDENTIFIER"\">\n"
  (:documentation "XML document type declaration of the introspection format version 1.0"))

;; === dbus-server.h

;; typedef struct DBusServer DBusServer;
(def-c-type DBusServer* c-pointer)

;; Called when a new connection to the server is available.
;; Must reference and save the new connection, or close the new connection.
;; Set with dbus_server_set_new_connection_function().
;; typedef void (* DBusNewConnectionFunction) (DBusServer *server, DBusConnection *new_connection, void *data);
(def-c-type DBusNewConnectionFunction
  (c-function (:return-type nil)
              (:arguments (server DBusServer*) (new_connection DBusConnection*)
                          (data c-pointer))))
(def-c-type DBusNewConnectionFunction* (c-pointer DBusNewConnectionFunction))


;; DBusServer* dbus_server_listen (const char *address, DBusError *error);
(def-call-out dbus_server_listen (:return-type DBusServer*)
  (:arguments (address c-string) (error (c-pointer DBusError))))

;; DBusServer* dbus_server_ref (DBusServer *server);
(def-call-out dbus_server_ref (:return-type DBusServer*)
  (:arguments (server DBusServer*)))

;; void dbus_server_unref (DBusServer *server);
(def-call-out dbus_server_unref (:return-type nil)
  (:arguments (server DBusServer*)))

;; void dbus_server_disconnect (DBusServer *server);
(def-call-out dbus_server_disconnect (:return-type nil)
  (:arguments (server DBusServer*)))

;; dbus_bool_t dbus_server_get_is_connected (DBusServer *server);
(def-call-out dbus_server_get_is_connected (:return-type dbus_bool_t)
  (:arguments (server DBusServer*)))

;; char* dbus_server_get_address (DBusServer *server);
(def-call-out dbus_server_get_address (:return-type c-string)
  (:arguments (server DBusServer*)))

;; char* dbus_server_get_id (DBusServer *server);
(def-call-out dbus_server_get_id (:return-type c-string)
  (:arguments (server DBusServer*)))

;; void dbus_server_set_new_connection_function (DBusServer *server, DBusNewConnectionFunction function, void *data, DBusFreeFunction free_data_function);
(def-call-out dbus_server_set_new_connection_function (:return-type nil)
  (:arguments (server DBusServer*) (function DBusNewConnectionFunction)
              (data c-pointer) (free_data_function DBusFreeFunction)))

;; dbus_bool_t dbus_server_set_watch_functions (DBusServer *server, DBusAddWatchFunction add_function, DBusRemoveWatchFunction remove_function, DBusWatchToggledFunction toggled_function, void *data, DBusFreeFunction free_data_function);
(def-call-out dbus_server_set_watch_functions (:return-type dbus_bool_t)
  (:arguments (server DBusServer*) (add_function DBusAddWatchFunction)
              (remove_function DBusRemoveWatchFunction)
              (toggled_function DBusWatchToggledFunction)
              (data c-pointer) (free_data_function DBusFreeFunction)))

;; dbus_bool_t dbus_server_set_timeout_functions (DBusServer *server, DBusAddTimeoutFunction add_function, DBusRemoveTimeoutFunction remove_function, DBusTimeoutToggledFunction toggled_function, void *data, DBusFreeFunction free_data_function);
(def-call-out dbus_server_set_timeout_functions (:return-type dbus_bool_t)
  (:arguments (server DBusServer*) (add_function DBusAddTimeoutFunction)
              (remove_function DBusRemoveTimeoutFunction)
              (toggled_function DBusTimeoutToggledFunction)
              (data c-pointer) (free_data_function DBusFreeFunction)))

;; dbus_bool_t dbus_server_set_auth_mechanisms (DBusServer *server, const char **mechanisms);
(def-call-out dbus_server_set_auth_mechanisms (:return-type dbus_bool_t)
  (:arguments (server DBusServer*) (*mechanisms c-string)))


;; dbus_bool_t dbus_server_allocate_data_slot (dbus_int32_t *slot_p);
(def-call-out dbus_server_allocate_data_slot (:return-type dbus_bool_t)
  (:arguments (slot_p (c-pointer dbus_int32_t))))

;; void dbus_server_free_data_slot (dbus_int32_t *slot_p);
(def-call-out dbus_server_free_data_slot (:return-type nil)
  (:arguments (slot_p (c-pointer dbus_int32_t))))

;; dbus_bool_t dbus_server_set_data (DBusServer *server, int slot, void *data, DBusFreeFunction free_data_func);
(def-call-out dbus_server_set_data (:return-type dbus_bool_t)
  (:arguments (server DBusServer*) (slot int) (data c-pointer)
              (free_data_func DBusFreeFunction)))

;; void* dbus_server_get_data (DBusServer *server, int slot);
(def-call-out dbus_server_get_data (:return-type c-pointer)
  (:arguments (server DBusServer*) (slot int)))

;; === dbus-signature.h

;; contains no public fields
;; typedef struct DBusSignatureIter DBusSignatureIter
(def-c-type DBusSignatureIter* c-pointer)

;; void dbus_signature_iter_init (DBusSignatureIter *iter, const char *signature);
(def-call-out dbus_signature_iter_init (:return-type nil)
  (:arguments (iter DBusSignatureIter*) (signature c-string)))


;; int dbus_signature_iter_get_current_type (const DBusSignatureIter *iter);
(def-call-out dbus_signature_iter_get_current_type (:return-type int)
  (:arguments (iter DBusSignatureIter*)))


;; char * dbus_signature_iter_get_signature (const DBusSignatureIter *iter);
(def-call-out dbus_signature_iter_get_signature (:return-type c-string)
  (:arguments (iter DBusSignatureIter*)))


;; int dbus_signature_iter_get_element_type (const DBusSignatureIter *iter);
(def-call-out dbus_signature_iter_get_element_type (:return-type int)
  (:arguments (iter DBusSignatureIter*)))


;; dbus_bool_t dbus_signature_iter_next (DBusSignatureIter *iter);
(def-call-out dbus_signature_iter_next (:return-type dbus_bool_t)
  (:arguments (iter DBusSignatureIter*)))


;; void dbus_signature_iter_recurse (const DBusSignatureIter *iter, DBusSignatureIter *subiter);
(def-call-out dbus_signature_iter_recurse (:return-type nil)
  (:arguments (iter DBusSignatureIter*) (subiter DBusSignatureIter*)))


;; dbus_bool_t dbus_signature_validate (const char *signature, DBusError *error);
(def-call-out dbus_signature_validate (:return-type dbus_bool_t)
  (:arguments (signature c-string) (error (c-pointer DBusError))))


;; dbus_bool_t dbus_signature_validate_single (const char *signature, DBusError *error);
(def-call-out dbus_signature_validate_single (:return-type dbus_bool_t)
  (:arguments (signature c-string) (error (c-pointer DBusError))))


;; dbus_bool_t dbus_type_is_basic (int typecode);
(def-call-out dbus_type_is_basic (:return-type dbus_bool_t)
  (:arguments (typecode int)))

;; dbus_bool_t dbus_type_is_container (int typecode);
(def-call-out dbus_type_is_container (:return-type dbus_bool_t)
  (:arguments (typecode int)))

;; dbus_bool_t dbus_type_is_fixed (int typecode);
(def-call-out dbus_type_is_fixed (:return-type dbus_bool_t)
  (:arguments (typecode int)))


;; === dbus-threads.h

;; An opaque mutex type provided by the #DBusThreadFunctions
;; implementation installed by dbus_threads_init().
;; typedef struct DBusMutex DBusMutex;
(def-c-type DBusMutex* c-pointer)

;; An opaque condition variable type provided by the
;; #DBusThreadFunctions implementation installed by dbus_threads_init().
;; typedef struct DBusCondVar DBusCondVar;
(def-c-type DBusCondVar* c-pointer)

;; Deprecated, provide DBusRecursiveMutexNewFunction instead.
;; typedef DBusMutex* (* DBusMutexNewFunction) (void);
(def-c-type DBusMutexNewFunction
  (c-function (:return-type DBusMutex*)
              (:arguments)))
(def-c-type DBusMutexNewFunction* (c-pointer DBusMutexNewFunction))

;; Deprecated, provide DBusRecursiveMutexFreeFunction instead.
;; typedef void (* DBusMutexFreeFunction) (DBusMutex *mutex);
(def-c-type DBusMutexFreeFunction
  (c-function (:return-type nil)
              (:arguments (mutex DBusMutex*))))
(def-c-type DBusMutexFreeFunction* (c-pointer DBusMutexFreeFunction))

;; Deprecated, provide DBusRecursiveMutexLockFunction instead.
;; Return value is lock success, but gets ignored in practice.
;; typedef dbus_bool_t (* DBusMutexLockFunction) (DBusMutex *mutex);
(def-c-type DBusMutexLockFunction
  (c-function (:return-type dbus_bool_t)
              (:arguments (mutex DBusMutex*))))
(def-c-type DBusMutexLockFunction* (c-pointer DBusMutexLockFunction))

;; Deprecated, provide DBusRecursiveMutexUnlockFunction instead.
;; Return value is unlock success, but gets ignored in practice.
;; typedef dbus_bool_t (* DBusMutexUnlockFunction) (DBusMutex *mutex);
(def-c-type DBusMutexUnlockFunction
  (c-function (:return-type dbus_bool_t)
              (:arguments (mutex DBusMutex*))))
(def-c-type DBusMutexUnlockFunction* (c-pointer DBusMutexUnlockFunction))


;; Creates a new recursively-lockable mutex, or returns #NULL if not
;; enough memory.  Can only fail due to lack of memory.  Found in
;; #DBusThreadFunctions. Do not just use PTHREAD_MUTEX_RECURSIVE for
;; this, because it does not save/restore the recursion count when
;; waiting on a condition. libdbus requires the Java-style behavior
;; where the mutex is fully unlocked to wait on a condition.
;; typedef DBusMutex* (* DBusRecursiveMutexNewFunction) (void);
(def-c-type DBusRecursiveMutexNewFunction
  (c-function (:return-type DBusMutex*)
              (:arguments)))
(def-c-type DBusRecursiveMutexNewFunction* (c-pointer DBusRecursiveMutexNewFunction))

;; Frees a recursively-lockable mutex.  Found in #DBusThreadFunctions.
;; typedef void (* DBusRecursiveMutexFreeFunction) (DBusMutex *mutex);
(def-c-type DBusRecursiveMutexFreeFunction
  (c-function (:return-type nil)
              (:arguments (mutex DBusMutex*))))
(def-c-type DBusRecursiveMutexFreeFunction* (c-pointer DBusRecursiveMutexFreeFunction))

;; Locks a recursively-lockable mutex.  Found in #DBusThreadFunctions.
;; Can only fail due to lack of memory.
;; typedef void (* DBusRecursiveMutexLockFunction) (DBusMutex *mutex);
(def-c-type DBusRecursiveMutexLockFunction
  (c-function (:return-type nil)
              (:arguments (mutex DBusMutex*))))
(def-c-type DBusRecursiveMutexLockFunction* (c-pointer DBusRecursiveMutexLockFunction))

;; Unlocks a recursively-lockable mutex.  Found in #DBusThreadFunctions.
;; Can only fail due to lack of memory.
;; typedef void (* DBusRecursiveMutexUnlockFunction) (DBusMutex *mutex);
(def-c-type DBusRecursiveMutexUnlockFunction
  (c-function (:return-type nil)
              (:arguments (mutex DBusMutex*))))
(def-c-type DBusRecursiveMutexUnlockFunction* (c-pointer DBusRecursiveMutexUnlockFunction))


;; Creates a new condition variable.  Found in #DBusThreadFunctions.
;; Can only fail (returning #NULL) due to lack of memory.
;; typedef DBusCondVar* (* DBusCondVarNewFunction) (void);
(def-c-type DBusCondVarNewFunction
  (c-function (:return-type DBusCondVar*)
              (:arguments)))
(def-c-type DBusCondVarNewFunction* (c-pointer DBusCondVarNewFunction))

;; Frees a condition variable.  Found in #DBusThreadFunctions.
;; typedef void (* DBusCondVarFreeFunction) (DBusCondVar *cond);
(def-c-type DBusCondVarFreeFunction
  (c-function (:return-type nil)
              (:arguments (cond DBusCondVar*))))
(def-c-type DBusCondVarFreeFunction* (c-pointer DBusCondVarFreeFunction))


;; Waits on a condition variable.  Found in
;; #DBusThreadFunctions. Must work with either a recursive or
;; nonrecursive mutex, whichever the thread implementation
;; provides. Note that PTHREAD_MUTEX_RECURSIVE does not work with
;; condition variables (does not save/restore the recursion count) so
;; don't try using simply pthread_cond_wait() and a
;; PTHREAD_MUTEX_RECURSIVE to implement this, it won't work right.
;; Has no error conditions. Must succeed if it returns.
;; typedef void (* DBusCondVarWaitFunction) (DBusCondVar *cond, DBusMutex *mutex);
(def-c-type DBusCondVarWaitFunction
  (c-function (:return-type nil)
              (:arguments (cond DBusCondVar*) (mutex DBusMutex*))))
(def-c-type DBusCondVarWaitFunction* (c-pointer DBusCondVarWaitFunction))


;; Waits on a condition variable with a timeout.  Found in
;; #DBusThreadFunctions. Returns #TRUE if the wait did not
;; time out, and #FALSE if it did.
;; Has no error conditions. Must succeed if it returns.
;; typedef dbus_bool_t (* DBusCondVarWaitTimeoutFunction) (DBusCondVar *cond, DBusMutex *mutex, int timeout_milliseconds);
(def-c-type DBusCondVarWaitTimeoutFunction
  (c-function (:return-type dbus_bool_t)
              (:arguments (cond DBusCondVar*) (mutex DBusMutex*)
                          (timeout_milliseconds int))))
(def-c-type DBusCondVarWaitTimeoutFunction* (c-pointer DBusCondVarWaitTimeoutFunction))

;; Wakes one waiting thread on a condition variable.
;; Found in #DBusThreadFunctions.
;; Has no error conditions. Must succeed if it returns.
;; typedef void (* DBusCondVarWakeOneFunction) (DBusCondVar *cond);
(def-c-type DBusCondVarWakeOneFunction
  (c-function (:return-type nil)
              (:arguments (cond DBusCondVar*))))
(def-c-type DBusCondVarWakeOneFunction* (c-pointer DBusCondVarWakeOneFunction))


;; Wakes all waiting threads on a condition variable.
;; Found in #DBusThreadFunctions.
;; Has no error conditions. Must succeed if it returns.
;; typedef void (* DBusCondVarWakeAllFunction) (DBusCondVar *cond);
(def-c-type DBusCondVarWakeAllFunction
  (c-function (:return-type nil)
              (:arguments (cond DBusCondVar*))))
(def-c-type DBusCondVarWakeAllFunction* (c-pointer DBusCondVarWakeAllFunction))



;; Flags indicating which functions are present in #DBusThreadFunctions.
;; Used to allow the library to detect older callers of dbus_threads_init()
;; if new possible functions are added to #DBusThreadFunctions.
(def-c-enum DBusThreadFunctionsMask
  (DBUS_THREAD_FUNCTIONS_MUTEX_NEW_MASK (ash 1 0))
  (DBUS_THREAD_FUNCTIONS_MUTEX_FREE_MASK (ash 1 1))
  (DBUS_THREAD_FUNCTIONS_MUTEX_LOCK_MASK (ash 1 2))
  (DBUS_THREAD_FUNCTIONS_MUTEX_UNLOCK_MASK (ash 1 3))
  (DBUS_THREAD_FUNCTIONS_CONDVAR_NEW_MASK (ash 1 4))
  (DBUS_THREAD_FUNCTIONS_CONDVAR_FREE_MASK (ash 1 5))
  (DBUS_THREAD_FUNCTIONS_CONDVAR_WAIT_MASK (ash 1 6))
  (DBUS_THREAD_FUNCTIONS_CONDVAR_WAIT_TIMEOUT_MASK (ash 1 7))
  (DBUS_THREAD_FUNCTIONS_CONDVAR_WAKE_ONE_MASK (ash 1 8))
  (DBUS_THREAD_FUNCTIONS_CONDVAR_WAKE_ALL_MASK (ash 1 9))
  (DBUS_THREAD_FUNCTIONS_RECURSIVE_MUTEX_NEW_MASK (ash 1 10))
  (DBUS_THREAD_FUNCTIONS_RECURSIVE_MUTEX_FREE_MASK (ash 1 11))
  (DBUS_THREAD_FUNCTIONS_RECURSIVE_MUTEX_LOCK_MASK (ash 1 12))
  (DBUS_THREAD_FUNCTIONS_RECURSIVE_MUTEX_UNLOCK_MASK (ash 1 13))
  (DBUS_THREAD_FUNCTIONS_ALL_MASK (1- (ash 1 14))))


;; Functions that must be implemented to make the D-Bus library
;; thread-aware. The recursive mutex functions should be specified
;; rather than the old, deprecated nonrecursive ones.

;; The condition variable functions have to work with recursive
;; mutexes if you provide those, or with nonrecursive mutexes if you
;; provide those.

;; If implementing threads using pthreads, be aware that
;; PTHREAD_MUTEX_RECURSIVE is broken in combination with condition
;; variables. libdbus relies on the Java-style behavior that when
;; waiting on a condition, the recursion count is saved and restored,
;; and the mutex is completely unlocked, not just decremented one
;; level of recursion.

;; Thus with pthreads you probably have to roll your own emulated
;; recursive mutexes, you can't use PTHREAD_MUTEX_RECURSIVE. This is
;; what dbus_threads_init_default() does on platforms that use
;; pthreads.
(def-c-struct DBusThreadFunctions
  (mask uint) ; Mask indicating which functions are present.
  (mutex_new DBusMutexNewFunction) ; Function to create a mutex; optional and deprecated.
  (mutex_free DBusMutexFreeFunction) ; Function to free a mutex; optional and deprecated.
  (mutex_lock DBusMutexLockFunction) ; Function to lock a mutex; optional and deprecated.
  (mutex_unlock DBusMutexUnlockFunction) ; Function to unlock a mutex; optional and deprecated.

  (condvar_new DBusCondVarNewFunction) ; Function to create a condition variable
  (condvar_free DBusCondVarFreeFunction) ; Function to free a condition variable
  (condvar_wait DBusCondVarWaitFunction) ; Function to wait on a condition
  (condvar_wait_timeout DBusCondVarWaitTimeoutFunction) ; Function to wait on a condition with a timeout
  (condvar_wake_one DBusCondVarWakeOneFunction) ; Function to wake one thread waiting on the condition
  (condvar_wake_all DBusCondVarWakeAllFunction) ; Function to wake all threads waiting on the condition

  (recursive_mutex_new DBusRecursiveMutexNewFunction) ; Function to create a recursive mutex
  (recursive_mutex_free DBusRecursiveMutexFreeFunction) ; Function to free a recursive mutex
  (recursive_mutex_lock DBusRecursiveMutexLockFunction) ; Function to lock a recursive mutex
  (recursive_mutex_unlock DBusRecursiveMutexUnlockFunction) ; Function to unlock a recursive mutex
  (padding1 c-pointer) ; Reserved for future expansion
  (padding2 c-pointer) ; Reserved for future expansion
  (padding3 c-pointer) ; Reserved for future expansion
  (padding4 c-pointer) ; Reserved for future expansion
  )

;; dbus_bool_t dbus_threads_init (const DBusThreadFunctions *functions);
(def-call-out dbus_threads_init (:return-type dbus_bool_t)
  (:arguments (functions (c-pointer DBusThreadFunctions))))

;; dbus_bool_t dbus_threads_init_default (void);
(def-call-out dbus_threads_init_default (:return-type dbus_bool_t)
  (:arguments))

;;; ===

(pushnew :dbus *features*)
(provide "dbus")
(pushnew "DBUS" custom:*system-package-list* :test #'string=)