-
Notifications
You must be signed in to change notification settings - Fork 67
/
lib.rs
1853 lines (1708 loc) · 78.1 KB
/
lib.rs
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
// Copyright 2016 Kyle Mayes
//
// Licensed 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.
//! Rust bindings for `libclang`.
//!
//! ## Supported Versions
//!
//! * 3.5 - [Documentation](https://kylemayes.github.io/clang-sys/3_5/clang_sys)
//! * 3.6 - [Documentation](https://kylemayes.github.io/clang-sys/3_6/clang_sys)
//! * 3.7 - [Documentation](https://kylemayes.github.io/clang-sys/3_7/clang_sys)
//! * 3.8 - [Documentation](https://kylemayes.github.io/clang-sys/3_8/clang_sys)
//! * 3.9 - [Documentation](https://kylemayes.github.io/clang-sys/3_9/clang_sys)
//! * 4.0 - [Documentation](https://kylemayes.github.io/clang-sys/4_0/clang_sys)
//! * 5.0 - [Documentation](https://kylemayes.github.io/clang-sys/5_0/clang_sys)
#![allow(non_camel_case_types, non_snake_case, non_upper_case_globals)]
#![cfg_attr(feature="clippy", feature(plugin))]
#![cfg_attr(feature="clippy", plugin(clippy))]
#![cfg_attr(feature="clippy", warn(clippy))]
extern crate glob;
extern crate libc;
#[cfg(feature="runtime")]
extern crate libloading;
pub mod support;
#[macro_use]
mod link;
use std::mem;
use libc::{c_char, c_int, c_longlong, c_uint, c_ulong, c_ulonglong, c_void, time_t};
pub type CXClientData = *mut c_void;
pub type CXCursorVisitor = extern fn(CXCursor, CXCursor, CXClientData) -> CXChildVisitResult;
#[cfg(feature="gte_clang_3_7")]
pub type CXFieldVisitor = extern fn(CXCursor, CXClientData) -> CXVisitorResult;
pub type CXInclusionVisitor = extern fn(CXFile, *mut CXSourceLocation, c_uint, CXClientData);
//================================================
// Macros
//================================================
// cenum! ________________________________________
/// Defines a C enum as a series of constants.
macro_rules! cenum {
($(#[$meta:meta])* enum $name:ident {
$($(#[$vmeta:meta])* const $variant:ident = $value:expr), +,
}) => (
pub type $name = c_int;
$($(#[$vmeta])* pub const $variant: $name = $value;)+
);
($(#[$meta:meta])* enum $name:ident {
$($(#[$vmeta:meta])* const $variant:ident = $value:expr); +;
}) => (
pub type $name = c_int;
$($(#[$vmeta])* pub const $variant: $name = $value;)+
);
}
// default! ______________________________________
/// Implements a zeroing implementation of `Default` for the supplied type.
macro_rules! default {
(#[$meta:meta] $ty:ty) => {
#[$meta]
impl Default for $ty {
fn default() -> $ty {
unsafe { mem::zeroed() }
}
}
};
($ty:ty) => {
impl Default for $ty {
fn default() -> $ty {
unsafe { mem::zeroed() }
}
}
};
}
//================================================
// Enums
//================================================
cenum! {
enum CXAvailabilityKind {
const CXAvailability_Available = 0,
const CXAvailability_Deprecated = 1,
const CXAvailability_NotAvailable = 2,
const CXAvailability_NotAccessible = 3,
}
}
cenum! {
enum CXCallingConv {
const CXCallingConv_Default = 0,
const CXCallingConv_C = 1,
const CXCallingConv_X86StdCall = 2,
const CXCallingConv_X86FastCall = 3,
const CXCallingConv_X86ThisCall = 4,
const CXCallingConv_X86Pascal = 5,
const CXCallingConv_AAPCS = 6,
const CXCallingConv_AAPCS_VFP = 7,
/// Only produced by `libclang` 4.0 and later.
const CXCallingConv_X86RegCall = 8,
const CXCallingConv_IntelOclBicc = 9,
const CXCallingConv_Win64 = 10,
const CXCallingConv_X86_64Win64 = 10,
const CXCallingConv_X86_64SysV = 11,
/// Only produced by `libclang` 3.6 and later.
const CXCallingConv_X86VectorCall = 12,
/// Only produced by `libclang` 3.9 and later.
const CXCallingConv_Swift = 13,
/// Only produced by `libclang` 3.9 and later.
const CXCallingConv_PreserveMost = 14,
/// Only produced by `libclang` 3.9 and later.
const CXCallingConv_PreserveAll = 15,
const CXCallingConv_Invalid = 100,
const CXCallingConv_Unexposed = 200,
}
}
cenum! {
enum CXChildVisitResult {
const CXChildVisit_Break = 0,
const CXChildVisit_Continue = 1,
const CXChildVisit_Recurse = 2,
}
}
cenum! {
enum CXCommentInlineCommandRenderKind {
const CXCommentInlineCommandRenderKind_Normal = 0,
const CXCommentInlineCommandRenderKind_Bold = 1,
const CXCommentInlineCommandRenderKind_Monospaced = 2,
const CXCommentInlineCommandRenderKind_Emphasized = 3,
}
}
cenum! {
enum CXCommentKind {
const CXComment_Null = 0,
const CXComment_Text = 1,
const CXComment_InlineCommand = 2,
const CXComment_HTMLStartTag = 3,
const CXComment_HTMLEndTag = 4,
const CXComment_Paragraph = 5,
const CXComment_BlockCommand = 6,
const CXComment_ParamCommand = 7,
const CXComment_TParamCommand = 8,
const CXComment_VerbatimBlockCommand = 9,
const CXComment_VerbatimBlockLine = 10,
const CXComment_VerbatimLine = 11,
const CXComment_FullComment = 12,
}
}
cenum! {
enum CXCommentParamPassDirection {
const CXCommentParamPassDirection_In = 0,
const CXCommentParamPassDirection_Out = 1,
const CXCommentParamPassDirection_InOut = 2,
}
}
cenum! {
enum CXCompilationDatabase_Error {
const CXCompilationDatabase_NoError = 0,
const CXCompilationDatabase_CanNotLoadDatabase = 1,
}
}
cenum! {
enum CXCompletionChunkKind {
const CXCompletionChunk_Optional = 0,
const CXCompletionChunk_TypedText = 1,
const CXCompletionChunk_Text = 2,
const CXCompletionChunk_Placeholder = 3,
const CXCompletionChunk_Informative = 4,
const CXCompletionChunk_CurrentParameter = 5,
const CXCompletionChunk_LeftParen = 6,
const CXCompletionChunk_RightParen = 7,
const CXCompletionChunk_LeftBracket = 8,
const CXCompletionChunk_RightBracket = 9,
const CXCompletionChunk_LeftBrace = 10,
const CXCompletionChunk_RightBrace = 11,
const CXCompletionChunk_LeftAngle = 12,
const CXCompletionChunk_RightAngle = 13,
const CXCompletionChunk_Comma = 14,
const CXCompletionChunk_ResultType = 15,
const CXCompletionChunk_Colon = 16,
const CXCompletionChunk_SemiColon = 17,
const CXCompletionChunk_Equal = 18,
const CXCompletionChunk_HorizontalSpace = 19,
const CXCompletionChunk_VerticalSpace = 20,
}
}
cenum! {
enum CXCursorKind {
const CXCursor_UnexposedDecl = 1,
const CXCursor_StructDecl = 2,
const CXCursor_UnionDecl = 3,
const CXCursor_ClassDecl = 4,
const CXCursor_EnumDecl = 5,
const CXCursor_FieldDecl = 6,
const CXCursor_EnumConstantDecl = 7,
const CXCursor_FunctionDecl = 8,
const CXCursor_VarDecl = 9,
const CXCursor_ParmDecl = 10,
const CXCursor_ObjCInterfaceDecl = 11,
const CXCursor_ObjCCategoryDecl = 12,
const CXCursor_ObjCProtocolDecl = 13,
const CXCursor_ObjCPropertyDecl = 14,
const CXCursor_ObjCIvarDecl = 15,
const CXCursor_ObjCInstanceMethodDecl = 16,
const CXCursor_ObjCClassMethodDecl = 17,
const CXCursor_ObjCImplementationDecl = 18,
const CXCursor_ObjCCategoryImplDecl = 19,
const CXCursor_TypedefDecl = 20,
const CXCursor_CXXMethod = 21,
const CXCursor_Namespace = 22,
const CXCursor_LinkageSpec = 23,
const CXCursor_Constructor = 24,
const CXCursor_Destructor = 25,
const CXCursor_ConversionFunction = 26,
const CXCursor_TemplateTypeParameter = 27,
const CXCursor_NonTypeTemplateParameter = 28,
const CXCursor_TemplateTemplateParameter = 29,
const CXCursor_FunctionTemplate = 30,
const CXCursor_ClassTemplate = 31,
const CXCursor_ClassTemplatePartialSpecialization = 32,
const CXCursor_NamespaceAlias = 33,
const CXCursor_UsingDirective = 34,
const CXCursor_UsingDeclaration = 35,
const CXCursor_TypeAliasDecl = 36,
const CXCursor_ObjCSynthesizeDecl = 37,
const CXCursor_ObjCDynamicDecl = 38,
const CXCursor_CXXAccessSpecifier = 39,
const CXCursor_ObjCSuperClassRef = 40,
const CXCursor_ObjCProtocolRef = 41,
const CXCursor_ObjCClassRef = 42,
const CXCursor_TypeRef = 43,
const CXCursor_CXXBaseSpecifier = 44,
const CXCursor_TemplateRef = 45,
const CXCursor_NamespaceRef = 46,
const CXCursor_MemberRef = 47,
const CXCursor_LabelRef = 48,
const CXCursor_OverloadedDeclRef = 49,
const CXCursor_VariableRef = 50,
const CXCursor_InvalidFile = 70,
const CXCursor_NoDeclFound = 71,
const CXCursor_NotImplemented = 72,
const CXCursor_InvalidCode = 73,
const CXCursor_UnexposedExpr = 100,
const CXCursor_DeclRefExpr = 101,
const CXCursor_MemberRefExpr = 102,
const CXCursor_CallExpr = 103,
const CXCursor_ObjCMessageExpr = 104,
const CXCursor_BlockExpr = 105,
const CXCursor_IntegerLiteral = 106,
const CXCursor_FloatingLiteral = 107,
const CXCursor_ImaginaryLiteral = 108,
const CXCursor_StringLiteral = 109,
const CXCursor_CharacterLiteral = 110,
const CXCursor_ParenExpr = 111,
const CXCursor_UnaryOperator = 112,
const CXCursor_ArraySubscriptExpr = 113,
const CXCursor_BinaryOperator = 114,
const CXCursor_CompoundAssignOperator = 115,
const CXCursor_ConditionalOperator = 116,
const CXCursor_CStyleCastExpr = 117,
const CXCursor_CompoundLiteralExpr = 118,
const CXCursor_InitListExpr = 119,
const CXCursor_AddrLabelExpr = 120,
const CXCursor_StmtExpr = 121,
const CXCursor_GenericSelectionExpr = 122,
const CXCursor_GNUNullExpr = 123,
const CXCursor_CXXStaticCastExpr = 124,
const CXCursor_CXXDynamicCastExpr = 125,
const CXCursor_CXXReinterpretCastExpr = 126,
const CXCursor_CXXConstCastExpr = 127,
const CXCursor_CXXFunctionalCastExpr = 128,
const CXCursor_CXXTypeidExpr = 129,
const CXCursor_CXXBoolLiteralExpr = 130,
const CXCursor_CXXNullPtrLiteralExpr = 131,
const CXCursor_CXXThisExpr = 132,
const CXCursor_CXXThrowExpr = 133,
const CXCursor_CXXNewExpr = 134,
const CXCursor_CXXDeleteExpr = 135,
const CXCursor_UnaryExpr = 136,
const CXCursor_ObjCStringLiteral = 137,
const CXCursor_ObjCEncodeExpr = 138,
const CXCursor_ObjCSelectorExpr = 139,
const CXCursor_ObjCProtocolExpr = 140,
const CXCursor_ObjCBridgedCastExpr = 141,
const CXCursor_PackExpansionExpr = 142,
const CXCursor_SizeOfPackExpr = 143,
const CXCursor_LambdaExpr = 144,
const CXCursor_ObjCBoolLiteralExpr = 145,
const CXCursor_ObjCSelfExpr = 146,
/// Only produced by `libclang` 3.8 and later.
const CXCursor_OMPArraySectionExpr = 147,
/// Only produced by `libclang` 3.9 and later.
const CXCursor_ObjCAvailabilityCheckExpr = 148,
const CXCursor_UnexposedStmt = 200,
const CXCursor_LabelStmt = 201,
const CXCursor_CompoundStmt = 202,
const CXCursor_CaseStmt = 203,
const CXCursor_DefaultStmt = 204,
const CXCursor_IfStmt = 205,
const CXCursor_SwitchStmt = 206,
const CXCursor_WhileStmt = 207,
const CXCursor_DoStmt = 208,
const CXCursor_ForStmt = 209,
const CXCursor_GotoStmt = 210,
const CXCursor_IndirectGotoStmt = 211,
const CXCursor_ContinueStmt = 212,
const CXCursor_BreakStmt = 213,
const CXCursor_ReturnStmt = 214,
/// Duplicate of `CXCursor_GccAsmStmt`.
const CXCursor_AsmStmt = 215,
const CXCursor_ObjCAtTryStmt = 216,
const CXCursor_ObjCAtCatchStmt = 217,
const CXCursor_ObjCAtFinallyStmt = 218,
const CXCursor_ObjCAtThrowStmt = 219,
const CXCursor_ObjCAtSynchronizedStmt = 220,
const CXCursor_ObjCAutoreleasePoolStmt = 221,
const CXCursor_ObjCForCollectionStmt = 222,
const CXCursor_CXXCatchStmt = 223,
const CXCursor_CXXTryStmt = 224,
const CXCursor_CXXForRangeStmt = 225,
const CXCursor_SEHTryStmt = 226,
const CXCursor_SEHExceptStmt = 227,
const CXCursor_SEHFinallyStmt = 228,
const CXCursor_MSAsmStmt = 229,
const CXCursor_NullStmt = 230,
const CXCursor_DeclStmt = 231,
const CXCursor_OMPParallelDirective = 232,
const CXCursor_OMPSimdDirective = 233,
const CXCursor_OMPForDirective = 234,
const CXCursor_OMPSectionsDirective = 235,
const CXCursor_OMPSectionDirective = 236,
const CXCursor_OMPSingleDirective = 237,
const CXCursor_OMPParallelForDirective = 238,
const CXCursor_OMPParallelSectionsDirective = 239,
const CXCursor_OMPTaskDirective = 240,
const CXCursor_OMPMasterDirective = 241,
const CXCursor_OMPCriticalDirective = 242,
const CXCursor_OMPTaskyieldDirective = 243,
const CXCursor_OMPBarrierDirective = 244,
const CXCursor_OMPTaskwaitDirective = 245,
const CXCursor_OMPFlushDirective = 246,
const CXCursor_SEHLeaveStmt = 247,
/// Only produced by `libclang` 3.6 and later.
const CXCursor_OMPOrderedDirective = 248,
/// Only produced by `libclang` 3.6 and later.
const CXCursor_OMPAtomicDirective = 249,
/// Only produced by `libclang` 3.6 and later.
const CXCursor_OMPForSimdDirective = 250,
/// Only produced by `libclang` 3.6 and later.
const CXCursor_OMPParallelForSimdDirective = 251,
/// Only produced by `libclang` 3.6 and later.
const CXCursor_OMPTargetDirective = 252,
/// Only produced by `libclang` 3.6 and later.
const CXCursor_OMPTeamsDirective = 253,
/// Only produced by `libclang` 3.7 and later.
const CXCursor_OMPTaskgroupDirective = 254,
/// Only produced by `libclang` 3.7 and later.
const CXCursor_OMPCancellationPointDirective = 255,
/// Only produced by `libclang` 3.7 and later.
const CXCursor_OMPCancelDirective = 256,
/// Only produced by `libclang` 3.8 and later.
const CXCursor_OMPTargetDataDirective = 257,
/// Only produced by `libclang` 3.8 and later.
const CXCursor_OMPTaskLoopDirective = 258,
/// Only produced by `libclang` 3.8 and later.
const CXCursor_OMPTaskLoopSimdDirective = 259,
/// Only produced by `libclang` 3.8 and later.
const CXCursor_OMPDistributeDirective = 260,
/// Only produced by `libclang` 3.9 and later.
const CXCursor_OMPTargetEnterDataDirective = 261,
/// Only produced by `libclang` 3.9 and later.
const CXCursor_OMPTargetExitDataDirective = 262,
/// Only produced by `libclang` 3.9 and later.
const CXCursor_OMPTargetParallelDirective = 263,
/// Only produced by `libclang` 3.9 and later.
const CXCursor_OMPTargetParallelForDirective = 264,
/// Only produced by `libclang` 3.9 and later.
const CXCursor_OMPTargetUpdateDirective = 265,
/// Only produced by `libclang` 3.9 and later.
const CXCursor_OMPDistributeParallelForDirective = 266,
/// Only produced by `libclang` 3.9 and later.
const CXCursor_OMPDistributeParallelForSimdDirective = 267,
/// Only produced by `libclang` 3.9 and later.
const CXCursor_OMPDistributeSimdDirective = 268,
/// Only produced by `libclang` 3.9 and later.
const CXCursor_OMPTargetParallelForSimdDirective = 269,
/// Only produced by `libclang` 4.0 and later.
const CXCursor_OMPTargetSimdDirective = 270,
/// Only produced by `libclang` 4.0 and later.
const CXCursor_OMPTeamsDistributeDirective = 271,
/// Only produced by `libclang` 4.0 and later.
const CXCursor_OMPTeamsDistributeSimdDirective = 272,
/// Only produced by `libclang` 4.0 and later.
const CXCursor_OMPTeamsDistributeParallelForSimdDirective = 273,
/// Only produced by `libclang` 4.0 and later.
const CXCursor_OMPTeamsDistributeParallelForDirective = 274,
/// Only produced by `libclang` 4.0 and later.
const CXCursor_OMPTargetTeamsDirective = 275,
/// Only produced by `libclang` 4.0 and later.
const CXCursor_OMPTargetTeamsDistributeDirective = 276,
/// Only produced by `libclang` 4.0 and later.
const CXCursor_OMPTargetTeamsDistributeParallelForDirective = 277,
/// Only produced by `libclang` 4.0 and later.
const CXCursor_OMPTargetTeamsDistributeParallelForSimdDirective = 278,
/// Only producer by `libclang` 4.0 and later.
const CXCursor_OMPTargetTeamsDistributeSimdDirective = 279,
const CXCursor_TranslationUnit = 300,
const CXCursor_UnexposedAttr = 400,
const CXCursor_IBActionAttr = 401,
const CXCursor_IBOutletAttr = 402,
const CXCursor_IBOutletCollectionAttr = 403,
const CXCursor_CXXFinalAttr = 404,
const CXCursor_CXXOverrideAttr = 405,
const CXCursor_AnnotateAttr = 406,
const CXCursor_AsmLabelAttr = 407,
const CXCursor_PackedAttr = 408,
const CXCursor_PureAttr = 409,
const CXCursor_ConstAttr = 410,
const CXCursor_NoDuplicateAttr = 411,
const CXCursor_CUDAConstantAttr = 412,
const CXCursor_CUDADeviceAttr = 413,
const CXCursor_CUDAGlobalAttr = 414,
const CXCursor_CUDAHostAttr = 415,
/// Only produced by `libclang` 3.6 and later.
const CXCursor_CUDASharedAttr = 416,
/// Only produced by `libclang` 3.8 and later.
const CXCursor_VisibilityAttr = 417,
/// Only produced by `libclang` 3.8 and later.
const CXCursor_DLLExport = 418,
/// Only produced by `libclang` 3.8 and later.
const CXCursor_DLLImport = 419,
const CXCursor_PreprocessingDirective = 500,
const CXCursor_MacroDefinition = 501,
/// Duplicate of `CXCursor_MacroInstantiation`.
const CXCursor_MacroExpansion = 502,
const CXCursor_InclusionDirective = 503,
const CXCursor_ModuleImportDecl = 600,
/// Only produced by `libclang` 3.8 and later.
const CXCursor_TypeAliasTemplateDecl = 601,
/// Only produced by `libclang` 3.9 and later.
const CXCursor_StaticAssert = 602,
/// Only produced by `libclang` 4.0 and later.
const CXCursor_FriendDecl = 603,
/// Only produced by `libclang` 3.7 and later.
const CXCursor_OverloadCandidate = 700,
}
}
cenum! {
#[cfg(feature="gte_clang_5_0")]
enum CXCursor_ExceptionSpecificationKind {
const CXCursor_ExceptionSpecificationKind_None = 0,
const CXCursor_ExceptionSpecificationKind_DynamicNone = 1,
const CXCursor_ExceptionSpecificationKind_Dynamic = 2,
const CXCursor_ExceptionSpecificationKind_MSAny = 3,
const CXCursor_ExceptionSpecificationKind_BasicNoexcept = 4,
const CXCursor_ExceptionSpecificationKind_ComputedNoexcept = 5,
const CXCursor_ExceptionSpecificationKind_Unevaluated = 6,
const CXCursor_ExceptionSpecificationKind_Uninstantiated = 7,
const CXCursor_ExceptionSpecificationKind_Unparsed = 8,
}
}
cenum! {
enum CXDiagnosticSeverity {
const CXDiagnostic_Ignored = 0,
const CXDiagnostic_Note = 1,
const CXDiagnostic_Warning = 2,
const CXDiagnostic_Error = 3,
const CXDiagnostic_Fatal = 4,
}
}
cenum! {
enum CXErrorCode {
const CXError_Success = 0,
const CXError_Failure = 1,
const CXError_Crashed = 2,
const CXError_InvalidArguments = 3,
const CXError_ASTReadError = 4,
}
}
cenum! {
enum CXEvalResultKind {
const CXEval_UnExposed = 0,
const CXEval_Int = 1 ,
const CXEval_Float = 2,
const CXEval_ObjCStrLiteral = 3,
const CXEval_StrLiteral = 4,
const CXEval_CFStr = 5,
const CXEval_Other = 6,
}
}
cenum! {
enum CXIdxAttrKind {
const CXIdxAttr_Unexposed = 0,
const CXIdxAttr_IBAction = 1,
const CXIdxAttr_IBOutlet = 2,
const CXIdxAttr_IBOutletCollection = 3,
}
}
cenum! {
enum CXIdxEntityCXXTemplateKind {
const CXIdxEntity_NonTemplate = 0,
const CXIdxEntity_Template = 1,
const CXIdxEntity_TemplatePartialSpecialization = 2,
const CXIdxEntity_TemplateSpecialization = 3,
}
}
cenum! {
enum CXIdxEntityKind {
const CXIdxEntity_Unexposed = 0,
const CXIdxEntity_Typedef = 1,
const CXIdxEntity_Function = 2,
const CXIdxEntity_Variable = 3,
const CXIdxEntity_Field = 4,
const CXIdxEntity_EnumConstant = 5,
const CXIdxEntity_ObjCClass = 6,
const CXIdxEntity_ObjCProtocol = 7,
const CXIdxEntity_ObjCCategory = 8,
const CXIdxEntity_ObjCInstanceMethod = 9,
const CXIdxEntity_ObjCClassMethod = 10,
const CXIdxEntity_ObjCProperty = 11,
const CXIdxEntity_ObjCIvar = 12,
const CXIdxEntity_Enum = 13,
const CXIdxEntity_Struct = 14,
const CXIdxEntity_Union = 15,
const CXIdxEntity_CXXClass = 16,
const CXIdxEntity_CXXNamespace = 17,
const CXIdxEntity_CXXNamespaceAlias = 18,
const CXIdxEntity_CXXStaticVariable = 19,
const CXIdxEntity_CXXStaticMethod = 20,
const CXIdxEntity_CXXInstanceMethod = 21,
const CXIdxEntity_CXXConstructor = 22,
const CXIdxEntity_CXXDestructor = 23,
const CXIdxEntity_CXXConversionFunction = 24,
const CXIdxEntity_CXXTypeAlias = 25,
const CXIdxEntity_CXXInterface = 26,
}
}
cenum! {
enum CXIdxEntityLanguage {
const CXIdxEntityLang_None = 0,
const CXIdxEntityLang_C = 1,
const CXIdxEntityLang_ObjC = 2,
const CXIdxEntityLang_CXX = 3,
/// Only produced by `libclang` 5.0 and later.
const CXIdxEntityLang_Swift = 4,
}
}
cenum! {
enum CXIdxEntityRefKind {
const CXIdxEntityRef_Direct = 1,
const CXIdxEntityRef_Implicit = 2,
}
}
cenum! {
enum CXIdxObjCContainerKind {
const CXIdxObjCContainer_ForwardRef = 0,
const CXIdxObjCContainer_Interface = 1,
const CXIdxObjCContainer_Implementation = 2,
}
}
cenum! {
enum CXLanguageKind {
const CXLanguage_Invalid = 0,
const CXLanguage_C = 1,
const CXLanguage_ObjC = 2,
const CXLanguage_CPlusPlus = 3,
}
}
cenum! {
enum CXLinkageKind {
const CXLinkage_Invalid = 0,
const CXLinkage_NoLinkage = 1,
const CXLinkage_Internal = 2,
const CXLinkage_UniqueExternal = 3,
const CXLinkage_External = 4,
}
}
cenum! {
enum CXLoadDiag_Error {
const CXLoadDiag_None = 0,
const CXLoadDiag_Unknown = 1,
const CXLoadDiag_CannotLoad = 2,
const CXLoadDiag_InvalidFile = 3,
}
}
cenum! {
enum CXRefQualifierKind {
const CXRefQualifier_None = 0,
const CXRefQualifier_LValue = 1,
const CXRefQualifier_RValue = 2,
}
}
cenum! {
enum CXResult {
const CXResult_Success = 0,
const CXResult_Invalid = 1,
const CXResult_VisitBreak = 2,
}
}
cenum! {
enum CXSaveError {
const CXSaveError_None = 0,
const CXSaveError_Unknown = 1,
const CXSaveError_TranslationErrors = 2,
const CXSaveError_InvalidTU = 3,
}
}
cenum! {
enum CXTUResourceUsageKind {
const CXTUResourceUsage_AST = 1,
const CXTUResourceUsage_Identifiers = 2,
const CXTUResourceUsage_Selectors = 3,
const CXTUResourceUsage_GlobalCompletionResults = 4,
const CXTUResourceUsage_SourceManagerContentCache = 5,
const CXTUResourceUsage_AST_SideTables = 6,
const CXTUResourceUsage_SourceManager_Membuffer_Malloc = 7,
const CXTUResourceUsage_SourceManager_Membuffer_MMap = 8,
const CXTUResourceUsage_ExternalASTSource_Membuffer_Malloc = 9,
const CXTUResourceUsage_ExternalASTSource_Membuffer_MMap = 10,
const CXTUResourceUsage_Preprocessor = 11,
const CXTUResourceUsage_PreprocessingRecord = 12,
const CXTUResourceUsage_SourceManager_DataStructures = 13,
const CXTUResourceUsage_Preprocessor_HeaderSearch = 14,
}
}
cenum! {
#[cfg(feature="gte_clang_3_6")]
enum CXTemplateArgumentKind {
const CXTemplateArgumentKind_Null = 0,
const CXTemplateArgumentKind_Type = 1,
const CXTemplateArgumentKind_Declaration = 2,
const CXTemplateArgumentKind_NullPtr = 3,
const CXTemplateArgumentKind_Integral = 4,
const CXTemplateArgumentKind_Template = 5,
const CXTemplateArgumentKind_TemplateExpansion = 6,
const CXTemplateArgumentKind_Expression = 7,
const CXTemplateArgumentKind_Pack = 8,
const CXTemplateArgumentKind_Invalid = 9,
}
}
cenum! {
enum CXTokenKind {
const CXToken_Punctuation = 0,
const CXToken_Keyword = 1,
const CXToken_Identifier = 2,
const CXToken_Literal = 3,
const CXToken_Comment = 4,
}
}
cenum! {
enum CXTypeKind {
const CXType_Invalid = 0,
const CXType_Unexposed = 1,
const CXType_Void = 2,
const CXType_Bool = 3,
const CXType_Char_U = 4,
const CXType_UChar = 5,
const CXType_Char16 = 6,
const CXType_Char32 = 7,
const CXType_UShort = 8,
const CXType_UInt = 9,
const CXType_ULong = 10,
const CXType_ULongLong = 11,
const CXType_UInt128 = 12,
const CXType_Char_S = 13,
const CXType_SChar = 14,
const CXType_WChar = 15,
const CXType_Short = 16,
const CXType_Int = 17,
const CXType_Long = 18,
const CXType_LongLong = 19,
const CXType_Int128 = 20,
const CXType_Float = 21,
const CXType_Double = 22,
const CXType_LongDouble = 23,
const CXType_NullPtr = 24,
const CXType_Overload = 25,
const CXType_Dependent = 26,
const CXType_ObjCId = 27,
const CXType_ObjCClass = 28,
const CXType_ObjCSel = 29,
/// Only produced by `libclang` 3.9 and later.
const CXType_Float128 = 30,
/// Only produced by `libclang` 5.0 and later.
const CXType_Half = 31,
const CXType_Complex = 100,
const CXType_Pointer = 101,
const CXType_BlockPointer = 102,
const CXType_LValueReference = 103,
const CXType_RValueReference = 104,
const CXType_Record = 105,
const CXType_Enum = 106,
const CXType_Typedef = 107,
const CXType_ObjCInterface = 108,
const CXType_ObjCObjectPointer = 109,
const CXType_FunctionNoProto = 110,
const CXType_FunctionProto = 111,
const CXType_ConstantArray = 112,
const CXType_Vector = 113,
const CXType_IncompleteArray = 114,
const CXType_VariableArray = 115,
const CXType_DependentSizedArray = 116,
const CXType_MemberPointer = 117,
/// Only produced by `libclang` 3.8 and later.
const CXType_Auto = 118,
/// Only produced by `libclang` 3.9 and later.
const CXType_Elaborated = 119,
/// Only produced by `libclang` 5.0 and later.
const CXType_Pipe = 120,
/// Only produced by `libclang` 5.0 and later.
const CXType_OCLImage1dRO = 121,
/// Only produced by `libclang` 5.0 and later.
const CXType_OCLImage1dArrayRO = 122,
/// Only produced by `libclang` 5.0 and later.
const CXType_OCLImage1dBufferRO = 123,
/// Only produced by `libclang` 5.0 and later.
const CXType_OCLImage2dRO = 124,
/// Only produced by `libclang` 5.0 and later.
const CXType_OCLImage2dArrayRO = 125,
/// Only produced by `libclang` 5.0 and later.
const CXType_OCLImage2dDepthRO = 126,
/// Only produced by `libclang` 5.0 and later.
const CXType_OCLImage2dArrayDepthRO = 127,
/// Only produced by `libclang` 5.0 and later.
const CXType_OCLImage2dMSAARO = 128,
/// Only produced by `libclang` 5.0 and later.
const CXType_OCLImage2dArrayMSAARO = 129,
/// Only produced by `libclang` 5.0 and later.
const CXType_OCLImage2dMSAADepthRO = 130,
/// Only produced by `libclang` 5.0 and later.
const CXType_OCLImage2dArrayMSAADepthRO = 131,
/// Only produced by `libclang` 5.0 and later.
const CXType_OCLImage3dRO = 132,
/// Only produced by `libclang` 5.0 and later.
const CXType_OCLImage1dWO = 133,
/// Only produced by `libclang` 5.0 and later.
const CXType_OCLImage1dArrayWO = 134,
/// Only produced by `libclang` 5.0 and later.
const CXType_OCLImage1dBufferWO = 135,
/// Only produced by `libclang` 5.0 and later.
const CXType_OCLImage2dWO = 136,
/// Only produced by `libclang` 5.0 and later.
const CXType_OCLImage2dArrayWO = 137,
/// Only produced by `libclang` 5.0 and later.
const CXType_OCLImage2dDepthWO = 138,
/// Only produced by `libclang` 5.0 and later.
const CXType_OCLImage2dArrayDepthWO = 139,
/// Only produced by `libclang` 5.0 and later.
const CXType_OCLImage2dMSAAWO = 140,
/// Only produced by `libclang` 5.0 and later.
const CXType_OCLImage2dArrayMSAAWO = 141,
/// Only produced by `libclang` 5.0 and later.
const CXType_OCLImage2dMSAADepthWO = 142,
/// Only produced by `libclang` 5.0 and later.
const CXType_OCLImage2dArrayMSAADepthWO = 143,
/// Only produced by `libclang` 5.0 and later.
const CXType_OCLImage3dWO = 144,
/// Only produced by `libclang` 5.0 and later.
const CXType_OCLImage1dRW = 145,
/// Only produced by `libclang` 5.0 and later.
const CXType_OCLImage1dArrayRW = 146,
/// Only produced by `libclang` 5.0 and later.
const CXType_OCLImage1dBufferRW = 147,
/// Only produced by `libclang` 5.0 and later.
const CXType_OCLImage2dRW = 148,
/// Only produced by `libclang` 5.0 and later.
const CXType_OCLImage2dArrayRW = 149,
/// Only produced by `libclang` 5.0 and later.
const CXType_OCLImage2dDepthRW = 150,
/// Only produced by `libclang` 5.0 and later.
const CXType_OCLImage2dArrayDepthRW = 151,
/// Only produced by `libclang` 5.0 and later.
const CXType_OCLImage2dMSAARW = 152,
/// Only produced by `libclang` 5.0 and later.
const CXType_OCLImage2dArrayMSAARW = 153,
/// Only produced by `libclang` 5.0 and later.
const CXType_OCLImage2dMSAADepthRW = 154,
/// Only produced by `libclang` 5.0 and later.
const CXType_OCLImage2dArrayMSAADepthRW = 155,
/// Only produced by `libclang` 5.0 and later.
const CXType_OCLImage3dRW = 156,
/// Only produced by `libclang` 5.0 and later.
const CXType_OCLSampler = 157,
/// Only produced by `libclang` 5.0 and later.
const CXType_OCLEvent = 158,
/// Only produced by `libclang` 5.0 and later.
const CXType_OCLQueue = 159,
/// Only produced by `libclang` 5.0 and later.
const CXType_OCLReserveID = 160,
}
}
cenum! {
enum CXTypeLayoutError {
const CXTypeLayoutError_Invalid = -1,
const CXTypeLayoutError_Incomplete = -2,
const CXTypeLayoutError_Dependent = -3,
const CXTypeLayoutError_NotConstantSize = -4,
const CXTypeLayoutError_InvalidFieldName = -5,
}
}
cenum! {
#[cfg(feature="gte_clang_3_8")]
enum CXVisibilityKind {
const CXVisibility_Invalid = 0,
const CXVisibility_Hidden = 1,
const CXVisibility_Protected = 2,
const CXVisibility_Default = 3,
}
}
cenum! {
enum CXVisitorResult {
const CXVisit_Break = 0,
const CXVisit_Continue = 1,
}
}
cenum! {
enum CX_CXXAccessSpecifier {
const CX_CXXInvalidAccessSpecifier = 0,
const CX_CXXPublic = 1,
const CX_CXXProtected = 2,
const CX_CXXPrivate = 3,
}
}
cenum! {
#[cfg(feature="gte_clang_3_6")]
enum CX_StorageClass {
const CX_SC_Invalid = 0,
const CX_SC_None = 1,
const CX_SC_Extern = 2,
const CX_SC_Static = 3,
const CX_SC_PrivateExtern = 4,
const CX_SC_OpenCLWorkGroupLocal = 5,
const CX_SC_Auto = 6,
const CX_SC_Register = 7,
}
}
//================================================
// Flags
//================================================
cenum! {
enum CXCodeComplete_Flags {
const CXCodeComplete_IncludeMacros = 1;
const CXCodeComplete_IncludeCodePatterns = 2;
const CXCodeComplete_IncludeBriefComments = 4;
}
}
cenum! {
enum CXCompletionContext {
const CXCompletionContext_Unexposed = 0;
const CXCompletionContext_AnyType = 1;
const CXCompletionContext_AnyValue = 2;
const CXCompletionContext_ObjCObjectValue = 4;
const CXCompletionContext_ObjCSelectorValue = 8;
const CXCompletionContext_CXXClassTypeValue = 16;
const CXCompletionContext_DotMemberAccess = 32;
const CXCompletionContext_ArrowMemberAccess = 64;
const CXCompletionContext_ObjCPropertyAccess = 128;
const CXCompletionContext_EnumTag = 256;
const CXCompletionContext_UnionTag = 512;
const CXCompletionContext_StructTag = 1024;
const CXCompletionContext_ClassTag = 2048;
const CXCompletionContext_Namespace = 4096;
const CXCompletionContext_NestedNameSpecifier = 8192;
const CXCompletionContext_ObjCInterface = 16384;
const CXCompletionContext_ObjCProtocol = 32768;
const CXCompletionContext_ObjCCategory = 65536;
const CXCompletionContext_ObjCInstanceMessage = 131072;
const CXCompletionContext_ObjCClassMessage = 262144;
const CXCompletionContext_ObjCSelectorName = 524288;
const CXCompletionContext_MacroName = 1048576;
const CXCompletionContext_NaturalLanguage = 2097152;
const CXCompletionContext_Unknown = 4194303;
}
}
cenum! {
enum CXDiagnosticDisplayOptions {
const CXDiagnostic_DisplaySourceLocation = 1;
const CXDiagnostic_DisplayColumn = 2;
const CXDiagnostic_DisplaySourceRanges = 4;
const CXDiagnostic_DisplayOption = 8;
const CXDiagnostic_DisplayCategoryId = 16;
const CXDiagnostic_DisplayCategoryName = 32;
}
}
cenum! {
enum CXGlobalOptFlags {
const CXGlobalOpt_None = 0;
const CXGlobalOpt_ThreadBackgroundPriorityForIndexing = 1;
const CXGlobalOpt_ThreadBackgroundPriorityForEditing = 2;
const CXGlobalOpt_ThreadBackgroundPriorityForAll = 3;
}
}
cenum! {
enum CXIdxDeclInfoFlags {
const CXIdxDeclFlag_Skipped = 1;
}
}
cenum! {
enum CXIndexOptFlags {
const CXIndexOptNone = 0;
const CXIndexOptSuppressRedundantRefs = 1;
const CXIndexOptIndexFunctionLocalSymbols = 2;
const CXIndexOptIndexImplicitTemplateInstantiations = 4;
const CXIndexOptSuppressWarnings = 8;
const CXIndexOptSkipParsedBodiesInSession = 16;
}
}
cenum! {
enum CXNameRefFlags {
const CXNameRange_WantQualifier = 1;
const CXNameRange_WantTemplateArgs = 2;
const CXNameRange_WantSinglePiece = 4;
}
}
cenum! {
enum CXObjCDeclQualifierKind {
const CXObjCDeclQualifier_None = 0;
const CXObjCDeclQualifier_In = 1;
const CXObjCDeclQualifier_Inout = 2;
const CXObjCDeclQualifier_Out = 4;
const CXObjCDeclQualifier_Bycopy = 8;
const CXObjCDeclQualifier_Byref = 16;
const CXObjCDeclQualifier_Oneway = 32;
}
}
cenum! {
enum CXObjCPropertyAttrKind {
const CXObjCPropertyAttr_noattr = 0;
const CXObjCPropertyAttr_readonly = 1;
const CXObjCPropertyAttr_getter = 2;
const CXObjCPropertyAttr_assign = 4;
const CXObjCPropertyAttr_readwrite = 8;
const CXObjCPropertyAttr_retain = 16;
const CXObjCPropertyAttr_copy = 32;
const CXObjCPropertyAttr_nonatomic = 64;