This file is indexed.

/usr/include/proton/cproton.i is in libqpid-proton2-dev 0.7-2.

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
/*
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */
typedef unsigned int size_t;
typedef signed int ssize_t;
typedef unsigned char uint8_t;
typedef signed char int8_t;
typedef unsigned short uint16_t;
typedef signed short int16_t;
typedef unsigned long int uint32_t;
typedef long int int32_t;
typedef unsigned long long int uint64_t;
typedef long long int int64_t;

/* Parse these interface header files to generate APIs for script languages */

%include "proton/import_export.h"
%include "proton/types.h"
%ignore pn_string_vformat;
%ignore pn_string_vaddf;
%include "proton/object.h"

%ignore pn_error_format;
%ignore pn_error_vformat;


/* checks that ensure only allowed values are supplied or returned */
%aggregate_check(int, check_error,
                 PN_EOS, PN_ERR, PN_OVERFLOW, PN_UNDERFLOW,
                 PN_STATE_ERR, PN_ARG_ERR, PN_TIMEOUT);

%aggregate_check(int, check_state,
                 PN_LOCAL_UNINIT, PN_LOCAL_ACTIVE, PN_LOCAL_CLOSED,
                 PN_REMOTE_UNINIT, PN_REMOTE_ACTIVE, PN_REMOTE_CLOSED);

%aggregate_check(int, check_disposition, 0,
                 PN_RECEIVED, PN_ACCEPTED, PN_REJECTED,
                 PN_RELEASED, PN_MODIFIED);

%aggregate_check(int, check_trace,
                 PN_TRACE_OFF, PN_TRACE_RAW, PN_TRACE_FRM, PN_TRACE_DRV);

%aggregate_check(int, check_format,
                 PN_DATA, PN_TEXT, PN_AMQP, PN_JSON);

%aggregate_check(int, check_sasl_outcome,
                 PN_SASL_NONE, PN_SASL_OK, PN_SASL_AUTH,
                 PN_SASL_SYS, PN_SASL_PERM, PN_SASL_TEMP);

%aggregate_check(int, check_sasl_state,
                 PN_SASL_CONF, PN_SASL_IDLE, PN_SASL_STEP,
                 PN_SASL_PASS, PN_SASL_FAIL);


%contract pn_code(int code)
{
 require:
  check_error(code);
}

%contract pn_error()
{
 ensure:
  pn_error != NULL;
}

%contract pn_error_free(pn_error_t *error)
{
 require:
  error != NULL;
}

%contract pn_error_clear(pn_error_t *error)
{
 require:
  error != NULL;
}

%contract pn_error_set(pn_error_t *error, int code, const char *text)
{
 require:
  error != NULL;
}

%contract pn_error_vformat(pn_error_t *error, int code, const char *fmt, va_list ap)
{
 require:
  error != NULL;
}

%contract pn_error_format(pn_error_t *error, int code, const char *fmt, ...)
{
 require:
  error != NULL;
}

%contract pn_error_code(pn_error_t *error)
{
 require:
  error != NULL;
}

%contract pn_error_text(pn_error_t *error)
{
 require:
  error != NULL;
}

%include "proton/error.h"

%contract pn_connection(void)
{
 ensure:
  pn_connection != NULL;
}

%contract pn_connection_state(pn_connection_t *connection)
{
 require:
  connection != NULL;
}

%contract pn_connection_error(pn_connection_t *connection)
{
 require:
  connection != NULL;
}

%contract pn_connection_get_container(pn_connection_t *connection)
{
 require:
  connection != NULL;
}

%contract pn_connection_set_container(pn_connection_t *connection, const char *container)
{
 require:
  connection != NULL;
}

%contract pn_connection_get_hostname(pn_connection_t *connection)
{
 require:
  connection != NULL;
}

%contract pn_connection_set_hostname(pn_connection_t *connection, const char *hostname)
{
 require:
  connection != NULL;
}

%contract pn_connection_remote_container(pn_connection_t *connection)
{
 require:
  connection != NULL;
}

%contract pn_connection_remote_hostname(pn_connection_t *connection)
{
 require:
  connection != NULL;
}

%contract pn_work_head(pn_connection_t *connection)
{
 require:
  connection != NULL;
}

%contract pn_work_next(pn_delivery_t *delivery)
{
 require:
  delivery != NULL;
}

%contract pn_session(pn_connection_t *connection)
{
 require:
  connection != NULL;
 ensure:
  pn_session != NULL;
}

%contract pn_transport(pn_connection_t *connection)
{
 require:
  connection != NULL;
 ensure:
  pn_transport != NULL;
}

%contract pn_session_head(pn_connection_t *connection, pn_state_t state)
{
 require:
  connection != NULL;
}

%contract pn_session_next(pn_session_t *session, pn_state_t state)
{
 require:
  session != NULL;
}

%contract pn_link_head(pn_connection_t *connection, pn_state_t state)
{
 require:
  connection != NULL;
}

%contract pn_link_next(pn_link_t *link, pn_state_t state)
{
 require:
  link != NULL;
}

%contract pn_connection_open(pn_connection_t *connection)
{
 require:
  connection != NULL;
}

%contract pn_connection_close(pn_connection_t *connection)
{
 require:
 connection != NULL;
}

%contract pn_connection_free(pn_connection_t *connection)
{
 require:
  connection != NULL;
}

%contract pn_transport_error(pn_transport_t *transport)
{
 require:
  transport != NULL;
}

%contract pn_transport_input(pn_transport_t *transport, char *bytes, size_t available)
{
 require:
  transport != NULL;
}

%contract pn_transport_output(pn_transport_t *transport, char *bytes, size_t size)
{
 require:
  transport != NULL;
}

#%contract pn_transport_tick(pn_transport_t *transport, pn_timestamp_t now)
#{
#  # this method currently always returns 0
#}

%contract pn_transport_trace(pn_transport_t *transport, pn_trace_t trace)
{
 require:
  transport != NULL;
}

%contract pn_transport_free(pn_transport_t *transport)
{
 require:
  transport != NULL;
}

%contract pn_session_state(pn_session_t *session)
{
 require:
  session != NULL;
}

%contract pn_session_error(pn_session_t *session)
{
 require:
  session != NULL;
}

%contract pn_sender(pn_session_t *session, const char *name)
{
 require:
  session != NULL;
 ensure:
  pn_sender != NULL;
}

%contract pn_receiver(pn_session_t *session, const char *name)
{
 require:
  session != NULL;
 ensure:
  pn_receiver != NULL;
}

%contract pn_session_connection(pn_session_t *session)
{
 require:
  session != NULL;
 ensure:
  pn_session_connection != NULL;
}

%contract pn_session_open(pn_session_t *session)
{
 require:
  session != NULL;
}

%contract pn_session_close(pn_session_t *session)
{
 require:
  session != NULL;
}

%contract pn_session_free(pn_session_t *session)
{
 require:
  session != NULL;
}

%contract pn_link_name(pn_link_t *link)
{
 require:
  link != NULL;
}

%contract pn_link_is_sender(pn_link_t *link)
{
 require:
  link != NULL;
}

%contract pn_link_is_receiver(pn_link_t *link)
{
 require:
  link != NULL;
}

%contract pn_link_state(pn_link_t *link)
{
 require:
  link != NULL;
}

%contract pn_link_error(pn_link_t *link)
{
 require:
  link != NULL;
}

%contract pn_link_session(pn_link_t *link)
{
 require:
  link != NULL;
 ensure:
  pn_link_session != NULL;
}

%contract pn_link_get_target(pn_link_t *link)
{
 require:
  link != NULL;
}

%contract pn_link_get_source(pn_link_t *link)
{
 require:
  link != NULL;
}

%contract pn_link_set_source(pn_link_t *link, const char *source)
{
 require:
  link != NULL;
}

%contract pn_link_set_target(pn_link_t *link, const char *target)
{
 require:
  link != NULL;
}

%contract pn_link_remote_source(pn_link_t *link)
{
 require:
  link != NULL;
}

%contract pn_link_remote_target(pn_link_t *link)
{
 require:
  link != NULL;
}

%contract pn_delivery(pn_link_t *link, pn_delivery_tag_t tag)
{
 require:
  link != NULL;
 ensure:
  pn_delivery != NULL;
}

%contract pn_link_current(pn_link_t *link)
{
 require:
  link != NULL;
}

%contract pn_link_advance(pn_link_t *link)
{
 require:
  link != NULL;
}

%contract pn_link_credit(pn_link_t *link)
{
 require:
  link != NULL;
}

%contract pn_link_queued(pn_link_t *link)
{
 require:
  link != NULL;
}

%contract pn_link_unsettled(pn_link_t *link)
{
 require:
  link != NULL;
}

%contract pn_unsettled_head(pn_link_t *link)
{
 require:
  link != NULL;
}

%contract pn_unsettled_next(pn_delivery_t *delivery)
{
 require:
  delivery != NULL;
}

%contract pn_link_open(pn_link_t *sender)
{
 require:
  sender != NULL;
}

%contract pn_link_close(pn_link_t *sender)
{
 require:
  sender != NULL;
}

%contract pn_link_free(pn_link_t *sender)
{
 require:
  sender != NULL;
}

%contract pn_link_send(pn_link_t *sender, const char *bytes, size_t n)
{
 require:
  sender != NULL;
}

%contract pn_link_drained(pn_link_t *sender)
{
 require:
  sender != NULL;
}

%contract pn_link_flow(pn_link_t *receiver, int credit)
{
 require:
  receiver != NULL;
}

%contract pn_link_drain(pn_link_t *receiver, int credit)
{
 require:
  receiver != NULL;
}

%contract pn_link_recv(pn_link_t *receiver, char *bytes, size_t n)
{
 require:
  receiver != NULL;
}

%contract pn_delivery_tag(pn_delivery_t *delivery)
{
 require:
  delivery != NULL;
}

%contract pn_delivery_link(pn_delivery_t *delivery)
{
 require:
  delivery != NULL;
}

%contract pn_delivery_local_state(pn_delivery_t *delivery)
{
 require:
  delivery != NULL;
}

%contract pn_delivery_remote_state(pn_delivery_t *delivery)
{
 require:
  delivery != NULL;
}

%contract pn_delivery_settled(pn_delivery_t *delivery)
{
 require:
  delivery != NULL;
}

%contract pn_delivery_pending(pn_delivery_t *delivery)
{
 require:
  delivery != NULL;
}

%contract pn_delivery_writable(pn_delivery_t *delivery)
{
 require:
  delivery != NULL;
}

%contract pn_delivery_readable(pn_delivery_t *delivery)
{
 require:
  delivery != NULL;
}

%contract pn_delivery_updated(pn_delivery_t *delivery)
{
 require:
  delivery != NULL;
}

%contract pn_delivery_clear(pn_delivery_t *delivery)
{
 require:
  delivery != NULL;
}

%contract pn_delivery_update(pn_delivery_t *delivery, pn_disposition_t disposition)
{
 require:
  delivery != NULL;
  check_disposition(disposition);
}

%contract pn_delivery_settle(pn_delivery_t *delivery)
{
 require:
  delivery != NULL;
}

%contract pn_delivery_dump(pn_delivery_t *delivery)
{
 require:
  delivery != NULL;
}

%include "proton/condition.h"
%include "proton/connection.h"
%include "proton/session.h"
%include "proton/link.h"
%include "proton/terminus.h"
%include "proton/delivery.h"
%include "proton/disposition.h"
%include "proton/transport.h"
%include "proton/event.h"

%contract pn_message_free(pn_message_t *msg)
{
 require:
  msg != NULL;
}

%contract pn_message_clear(pn_message_t *msg)
{
 require:
  msg != NULL;
}

%contract pn_message_errno(pn_message_t *msg)
{
 require:
  msg != NULL;
}

%contract pn_message_error(pn_message_t *msg)
{
 require:
  msg != NULL;
}

%contract pn_message_is_durable(pn_message_t *msg)
{
 require:
  msg != NULL;
}

%contract pn_message_set_durable(pn_message_t *msg, bool durable)
{
 require:
  msg != NULL;
}

%contract pn_message_get_priority(pn_message_t *msg)
{
 require:
  msg != NULL;
}

%contract pn_message_set_priority(pn_message_t *msg, uint8_t priority)
{
 require:
  msg != NULL;
}

%contract pn_message_get_ttl(pn_message_t *msg)
{
 require:
  msg != NULL;
}

%contract pn_message_set_ttl(pn_message_t *msg, pn_millis_t ttl)
{
 require:
  msg != NULL;
}

%contract pn_message_is_first_acquirer(pn_message_t *msg)
{
 require:
  msg != NULL;
}

%contract pn_message_set_first_acquirer(pn_message_t *msg, bool first)
{
 require:
  msg != NULL;
}

%contract pn_message_get_delivery_count(pn_message_t *msg)
{
 require:
  msg != NULL;
}

%contract pn_message_set_delivery_count(pn_message_t *msg, uint32_t count)
{
 require:
  msg != NULL;
}

%contract pn_message_get_id(pn_message_t *msg)
{
 require:
  msg != NULL;
}

%contract pn_message_set_id(pn_message_t *msg, pn_atom_t id)
{
 require:
  msg != NULL;
}

%contract pn_message_get_user_id(pn_message_t *msg)
{
 require:
  msg != NULL;
}

%contract pn_message_set_user_id(pn_message_t *msg, pn_bytes_t user_id)
{
 require:
  msg != NULL;
}

%contract pn_message_get_address(pn_message_t *msg)
{
 require:
  msg != NULL;
}

%contract pn_message_set_address(pn_message_t *msg, const char *address)
{
 require:
  msg != NULL;
}

%contract pn_message_get_subject(pn_message_t *msg)
{
 require:
  msg != NULL;
}

%contract pn_message_set_subject(pn_message_t *msg, const char *subject)
{
 require:
  msg != NULL;
}

%contract pn_message_get_reply_to(pn_message_t *msg)
{
 require:
  msg != NULL;
}

%contract pn_message_set_reply_to(pn_message_t *msg, const char *reply_to)
{
 require:
  msg != NULL;
}

%contract pn_message_get_correlation_id(pn_message_t *msg)
{
 require:
  msg != NULL;
}

%contract pn_message_set_correlation_id(pn_message_t *msg, pn_atom_t atom)
{
 require:
  msg != NULL;
}

%contract pn_message_get_content_type(pn_message_t *msg)
{
 require:
  msg != NULL;
}

%contract pn_message_set_content_type(pn_message_t *msg, const char *type)
{
 require:
  msg != NULL;
}

%contract pn_message_get_content_encoding(pn_message_t *msg)
{
 require:
  msg != NULL;
}

%contract pn_message_set_content_encoding(pn_message_t *msg, const char *encoding)
{
 require:
  msg != NULL;
}

%contract pn_message_get_expiry_time(pn_message_t *msg)
{
 require:
  msg != NULL;
}

%contract pn_message_set_expiry_time(pn_message_t *msg, pn_timestamp_t time)
{
 require:
  msg != NULL;
}

%contract pn_message_get_creation_time(pn_message_t *msg)
{
 require:
  msg != NULL;
}

%contract pn_message_set_creation_time(pn_message_t *msg, pn_timestamp_t time)
{
 require:
  msg != NULL;
}

%contract pn_message_get_group_id(pn_message_t *msg)
{
 require:
  msg != NULL;
}

%contract pn_message_set_group_id(pn_message_t *msg, const char *group_id)
{
 require:
  msg != NULL;
}

%contract pn_message_get_group_sequence(pn_message_t *msg)
{
 require:
  msg != NULL;
}

%contract pn_message_set_group_sequence(pn_message_t *msg, pn_sequence_t n)
{
 require:
  msg != NULL;
}

%contract pn_message_get_reply_to_group_id(pn_message_t *msg)
{
 require:
  msg != NULL;
}

%contract pn_message_set_reply_to_group_id(pn_message_t *msg, const char *reply_to_group_id)
{
 require:
  msg != NULL;
}

%contract pn_message_get_format(pn_message_t *message)
{
 require:
  message != NULL;
 ensure:
  check_format(pn_message_get_format);
}

%contract pn_message_set_format(pn_message_t *message, pn_format_t format)
{
 require:
  message != NULL;
  check_format(format);
}

%contract pn_message_load(pn_message_t *message, const char *data, size_t size)
{
 require:
  message != NULL;
  size >= 0;
}

%contract pn_message_load_data(pn_message_t *message, const char *data, size_t size)
{
 require:
  message != NULL;
  size >= 0;
}

%contract pn_message_load_text(pn_message_t *message, const char *data, size_t size)
{
 require:
  message != NULL;
  size >= 0;
}

%contract pn_message_load_amqp(pn_message_t *message, const char *data, size_t size)
{
 require:
  message != NULL;
  size >= 0;
}

%contract pn_message_load_json(pn_message_t *message, const char *data, size_t size)
{
 require:
  message != NULL;
  size >= 0;
}

%contract pn_message_save(pn_message_t *message, char *data, size_t *size)
{
 require:
  message != NULL;
  *size >= 0;
}

%contract pn_message_save_data(pn_message_t *message, char *data, size_t *size)
{
 require:
  message != NULL;
  *size >= 0;
}

%contract pn_message_save_text(pn_message_t *message, char *data, size_t *size)
{
 require:
  message != NULL;
  *size >= 0;
}

%contract pn_message_save_amqp(pn_message_t *message, char *data, size_t *size)
{
 require:
  message != NULL;
  *size >= 0;
}

%contract pn_message_save_json(pn_message_t *message, char *data, size_t *size)
{
 require:
  message != NULL;
  *size >= 0;
}

%contract pn_message_decode(pn_message_t *msg, const char *bytes, size_t size)
{
 require:
  msg != NULL;
  size >= 0;
}

%contract pn_message_encode(pn_message_t *msg, char *bytes, size_t *size)
{
 require:
  msg != NULL;
  *size >= 0;
}

%contract pn_message_data(char *dst, size_t available, const char *src, size_t size)
{
 ensure:
  pn_message_data >= 0;
}

%include "proton/message.h"

%contract pn_sasl()
{
 ensure:
  pn_sasl != NULL;
}

%contract pn_sasl_state(pn_sasl_t *sasl)
{
 require:
  sasl != NULL;
 ensure:
  check_sasl_state(pn_sasl_state);
}

%contract pn_sasl_mechanisms(pn_sasl_t *sasl, const char *mechanisms)
{
 require:
  sasl != NULL;
}

%contract pn_sasl_remote_mechanisms(pn_sasl_t *sasl)
{
 require:
  sasl != NULL;
}

%contract pn_sasl_client(pn_sasl_t *sasl)
{
 require:
  sasl != NULL;
}

%contract pn_sasl_server(pn_sasl_t *sasl)
{
 require:
  sasl != NULL;
}

%contract pn_sasl_plain(pn_sasl_t *sasl, const char *username, const char *password)
{
 require:
  sasl != NULL;
}

%contract pn_sasl_pending(pn_sasl_t *sasl)
{
 require:
  sasl != NULL;
}

%contract pn_sasl_recv(pn_sasl_t *sasl, char *bytes, size_t size)
{
 require:
  sasl != NULL;
  bytes != NULL;
  size > 0;
}

%contract pn_sasl_send(pn_sasl_t *sasl, const char *bytes, size_t size)
{
 require:
  sasl != NULL;
  bytes != NULL;
  size > 0;
}

%contract pn_sasl_done(pn_sasl_t *sasl, pn_sasl_outcome_t outcome)
{
 require:
  sasl != NULL;
  check_sasl_outcome(outcome);
}

%contract pn_sasl_outcome(pn_sasl_t *sasl)
{
 require:
  sasl != NULL;
 ensure:
  check_sasl_outcome(pn_sasl_outcome);
}

%include "proton/sasl.h"

%contract pn_driver(void)
{
 ensure:
  pn_driver != NULL;
}

%contract pn_driver_trace(pn_driver_t *driver, pn_trace_t trace)
{
 require:
  driver != NULL;
  check_trace(trace);
}

%contract pn_driver_wakeup(pn_driver_t *driver)
{
 require:
  driver != NULL;
}

%contract pn_driver_wait(pn_driver_t *driver, int timeout)
{
 require:
  driver != NULL;
  timeout >= -1;
}

/** Get the next listener with pending data in the driver.
 *
 * @param[in] driver the driver
 * @return NULL if no active listener available
 */
%contract pn_driver_listener(pn_driver_t *driver)
{
 require:
  driver != NULL;
}

%contract pn_driver_connector(pn_driver_t *driver)
{
 require:
  driver != NULL;
}

%contract pn_driver_free(pn_driver_t *driver)
{
 require:
  driver != NULL;
}

%contract pn_listener(pn_driver_t *driver, const char *host,
                      const char *port, void* context)
{
 require:
  driver != NULL;
  host != NULL;
  port != NULL;
}

%contract pn_listener_fd(pn_driver_t *driver, int fd, void *context)
{
 require:
  driver != NULL;
  fd >= 0;
}

%contract pn_listener_trace(pn_listener_t *listener, pn_trace_t trace)
{
 require:
  listener != NULL;
  check_trace(trace);
}

%contract pn_listener_accept(pn_listener_t *listener)
{
 require:
  listener != NULL;
 ensure:
  pn_listener_accept != NULL;
}

%contract pn_listener_context(pn_listener_t *listener)
{
 require:
  listener != NULL;
}

%contract pn_listener_set_context(pn_listener_t *listener, void *context)
{
 require:
  listener != NULL;
}

%contract pn_listener_close(pn_listener_t *listener)
{
 require:
  listener != NULL;
}

%contract pn_listener_free(pn_listener_t *listener)
{
 require:
  listener != NULL;
}


%contract pn_connector(pn_driver_t *driver, const char *host,
                       const char *port, void* context)
{
 require:
  driver != NULL;
  host != NULL;
  port != NULL;
 ensure:
  pn_connector != NULL;
}

%contract pn_connector_fd(pn_driver_t *driver, int fd, void *context)
{
 require:
  driver != NULL;
  fd >= 0;
 ensure:
  pn_connector_fd != NULL;
}

%contract pn_connector_trace(pn_connector_t *connector, pn_trace_t trace)
{
 require:
  connector != NULL;
  check_trace(trace);
}

%contract pn_connector_process(pn_connector_t *connector)
{
 require:
  connector != NULL;
}

%contract pn_connector_listener(pn_connector_t *connector)
{
 require:
  connector != NULL;
}

%contract pn_connector_sasl(pn_connector_t *connector)
{
 require:
  connector != NULL;
}

%contract pn_connector_connection(pn_connector_t *connector)
{
 require:
  connector != NULL;
}

%contract pn_connector_set_connection(pn_connector_t *ctor, pn_connection_t *connection)
{
 require:
  ctor != NULL;
}

%contract pn_connector_context(pn_connector_t *connector)
{
 require:
  connector != NULL;
}

%contract pn_connector_set_context(pn_connector_t *connector, void *context)
{
 require:
  connector != NULL;
}

%contract pn_connector_close(pn_connector_t *connector)
{
 require:
  connector != NULL;
}

%contract pn_connector_closed(pn_connector_t *connector)
{
 require:
  connector != NULL;
}

%contract pn_connector_free(pn_connector_t *connector)
{
 require:
  connector != NULL;
}


%include "proton/driver.h"
%include "proton/driver_extras.h"

%contract pn_messenger(const char *name)
{
 ensure:
  pn_message != NULL;
}

%contract pn_messenger_name(pn_messenger_t *messenger)
{
 require:
  messenger != NULL;
 ensure:
  pn_messenger_name != NULL;
}

%contract pn_messenger_set_timeout(pn_messenger_t *messenger, int timeout)
{
 require:
  messenger != NULL;
}

%contract pn_messenger_get_timeout(pn_messenger_t *messenger)
{
 require:
  messenger != NULL;
}

%contract pn_messenger_free(pn_messenger_t *messenger)
{
 require:
  messenger != NULL;
}

%contract pn_messenger_errno(pn_messenger_t *messenger)
{
 require:
  messenger != NULL;
}

%contract pn_messenger_error(pn_messenger_t *messenger)
{
 require:
  messenger != NULL;
}

%contract pn_messenger_start(pn_messenger_t *messenger)
{
 require:
  messenger != NULL;
}

%contract pn_messenger_stop(pn_messenger_t *messenger)
{
 require:
  messenger != NULL;
}

%contract pn_messenger_subscribe(pn_messenger_t *messenger, const char *source)
{
 require:
  messenger != NULL;
  source != NULL;
}

%contract pn_messenger_put(pn_messenger_t *messenger, pn_message_t *msg)
{
 require:
  messenger != NULL;
  msg != NULL;
}

%contract pn_messenger_send(pn_messenger_t *messenger)
{
 require:
  messenger != NULL;
}

%contract pn_messenger_recv(pn_messenger_t *messenger, int n)
{
 require:
  messenger != NULL;
}

%contract pn_messenger_get(pn_messenger_t *messenger, pn_message_t *msg)
{
 require:
  messenger != NULL;
}

%contract pn_messenger_outgoing(pn_messenger_t *messenger)
{
 require:
  messenger != NULL;
 ensure:
  pn_messenger_outgoing >= 0;
}

%contract pn_messenger_incoming(pn_messenger_t *messenger)
{
 require:
  messenger != NULL;
 ensure:
  pn_messenger_incoming >= 0;
}


%include "proton/messenger.h"

%include "proton/io.h"

%include "proton/selectable.h"

%include "proton/ssl.h"

%ignore pn_decode_atoms;
%ignore pn_encode_atoms;
%ignore pn_decode_one;

%ignore pn_print_atom;
%ignore pn_type_str;
%ignore pn_print_atoms;
%ignore pn_format_atoms;
%ignore pn_format_atom;

%ignore pn_fill_atoms;
%ignore pn_vfill_atoms;
%ignore pn_ifill_atoms;
%ignore pn_vifill_atoms;
%ignore pn_scan_atoms;
%ignore pn_vscan_atoms;
%ignore pn_data_vfill;
%ignore pn_data_vscan;

%include "proton/codec.h"