xref: /third_party/rust/crates/clang-sys/src/lib.rs (revision 6cdb10c1)
1// SPDX-License-Identifier: Apache-2.0
2
3//! Rust bindings for `libclang`.
4//!
5//! ## [Documentation](https://docs.rs/clang-sys)
6//!
7//! Note that the documentation on https://docs.rs for this crate assumes usage
8//! of the `runtime` Cargo feature as well as the Cargo feature for the latest
9//! supported version of `libclang` (e.g., `clang_11_0`), neither of which are
10//! enabled by default.
11//!
12//! Due to the usage of the `runtime` Cargo feature, this documentation will
13//! contain some additional types and functions to manage a dynamically loaded
14//! `libclang` instance at runtime.
15//!
16//! Due to the usage of the Cargo feature for the latest supported version of
17//! `libclang`, this documentation will contain constants and functions that are
18//! not available in the oldest supported version of `libclang` (3.5). All of
19//! these types and functions have a documentation comment which specifies the
20//! minimum `libclang` version required to use the item.
21
22#![allow(non_camel_case_types, non_snake_case, non_upper_case_globals)]
23#![cfg_attr(feature = "cargo-clippy", allow(clippy::unreadable_literal))]
24
25extern crate glob;
26extern crate libc;
27#[cfg(feature = "runtime")]
28extern crate libloading;
29
30pub mod support;
31
32#[macro_use]
33mod link;
34
35use std::mem;
36
37use libc::*;
38
39pub type CXClientData = *mut c_void;
40pub type CXCursorVisitor = extern "C" fn(CXCursor, CXCursor, CXClientData) -> CXChildVisitResult;
41#[cfg(feature = "clang_3_7")]
42pub type CXFieldVisitor = extern "C" fn(CXCursor, CXClientData) -> CXVisitorResult;
43pub type CXInclusionVisitor = extern "C" fn(CXFile, *mut CXSourceLocation, c_uint, CXClientData);
44
45//================================================
46// Macros
47//================================================
48
49/// Defines a C enum as a series of constants.
50macro_rules! cenum {
51    ($(#[$meta:meta])* enum $name:ident {
52        $($(#[$vmeta:meta])* const $variant:ident = $value:expr), +,
53    }) => (
54        pub type $name = c_int;
55
56        $($(#[$vmeta])* pub const $variant: $name = $value;)+
57    );
58    ($(#[$meta:meta])* enum $name:ident {
59        $($(#[$vmeta:meta])* const $variant:ident = $value:expr); +;
60    }) => (
61        pub type $name = c_int;
62
63        $($(#[$vmeta])* pub const $variant: $name = $value;)+
64    );
65}
66
67/// Implements a zeroing implementation of `Default` for the supplied type.
68macro_rules! default {
69    (#[$meta:meta] $ty:ty) => {
70        #[$meta]
71        impl Default for $ty {
72            fn default() -> $ty {
73                unsafe { mem::zeroed() }
74            }
75        }
76    };
77
78    ($ty:ty) => {
79        impl Default for $ty {
80            fn default() -> $ty {
81                unsafe { mem::zeroed() }
82            }
83        }
84    };
85}
86
87//================================================
88// Enums
89//================================================
90
91cenum! {
92    enum CXAvailabilityKind {
93        const CXAvailability_Available = 0,
94        const CXAvailability_Deprecated = 1,
95        const CXAvailability_NotAvailable = 2,
96        const CXAvailability_NotAccessible = 3,
97    }
98}
99
100cenum! {
101    enum CXCallingConv {
102        const CXCallingConv_Default = 0,
103        const CXCallingConv_C = 1,
104        const CXCallingConv_X86StdCall = 2,
105        const CXCallingConv_X86FastCall = 3,
106        const CXCallingConv_X86ThisCall = 4,
107        const CXCallingConv_X86Pascal = 5,
108        const CXCallingConv_AAPCS = 6,
109        const CXCallingConv_AAPCS_VFP = 7,
110        /// Only produced by `libclang` 4.0 and later.
111        const CXCallingConv_X86RegCall = 8,
112        const CXCallingConv_IntelOclBicc = 9,
113        const CXCallingConv_Win64 = 10,
114        const CXCallingConv_X86_64Win64 = 10,
115        const CXCallingConv_X86_64SysV = 11,
116        /// Only produced by `libclang` 3.6 and later.
117        const CXCallingConv_X86VectorCall = 12,
118        /// Only produced by `libclang` 3.9 and later.
119        const CXCallingConv_Swift = 13,
120        /// Only produced by `libclang` 3.9 and later.
121        const CXCallingConv_PreserveMost = 14,
122        /// Only produced by `libclang` 3.9 and later.
123        const CXCallingConv_PreserveAll = 15,
124        /// Only produced by `libclang` 8.0 and later.
125        const CXCallingConv_AArch64VectorCall = 16,
126        const CXCallingConv_Invalid = 100,
127        const CXCallingConv_Unexposed = 200,
128        /// Only produced by `libclang` 13.0 and later.
129        const CXCallingConv_SwiftAsync = 17,
130        /// Only produced by `libclang` 15.0 and later.
131        const CXCallingConv_AArch64SVEPCS = 18,
132    }
133}
134
135cenum! {
136    enum CXChildVisitResult {
137        const CXChildVisit_Break = 0,
138        const CXChildVisit_Continue = 1,
139        const CXChildVisit_Recurse = 2,
140    }
141}
142
143cenum! {
144    enum CXCommentInlineCommandRenderKind {
145        const CXCommentInlineCommandRenderKind_Normal = 0,
146        const CXCommentInlineCommandRenderKind_Bold = 1,
147        const CXCommentInlineCommandRenderKind_Monospaced = 2,
148        const CXCommentInlineCommandRenderKind_Emphasized = 3,
149    }
150}
151
152cenum! {
153    enum CXCommentKind {
154        const CXComment_Null = 0,
155        const CXComment_Text = 1,
156        const CXComment_InlineCommand = 2,
157        const CXComment_HTMLStartTag = 3,
158        const CXComment_HTMLEndTag = 4,
159        const CXComment_Paragraph = 5,
160        const CXComment_BlockCommand = 6,
161        const CXComment_ParamCommand = 7,
162        const CXComment_TParamCommand = 8,
163        const CXComment_VerbatimBlockCommand = 9,
164        const CXComment_VerbatimBlockLine = 10,
165        const CXComment_VerbatimLine = 11,
166        const CXComment_FullComment = 12,
167    }
168}
169
170cenum! {
171    enum CXCommentParamPassDirection {
172        const CXCommentParamPassDirection_In = 0,
173        const CXCommentParamPassDirection_Out = 1,
174        const CXCommentParamPassDirection_InOut = 2,
175    }
176}
177
178cenum! {
179    enum CXCompilationDatabase_Error {
180        const CXCompilationDatabase_NoError = 0,
181        const CXCompilationDatabase_CanNotLoadDatabase = 1,
182    }
183}
184
185cenum! {
186    enum CXCompletionChunkKind {
187        const CXCompletionChunk_Optional = 0,
188        const CXCompletionChunk_TypedText = 1,
189        const CXCompletionChunk_Text = 2,
190        const CXCompletionChunk_Placeholder = 3,
191        const CXCompletionChunk_Informative = 4,
192        const CXCompletionChunk_CurrentParameter = 5,
193        const CXCompletionChunk_LeftParen = 6,
194        const CXCompletionChunk_RightParen = 7,
195        const CXCompletionChunk_LeftBracket = 8,
196        const CXCompletionChunk_RightBracket = 9,
197        const CXCompletionChunk_LeftBrace = 10,
198        const CXCompletionChunk_RightBrace = 11,
199        const CXCompletionChunk_LeftAngle = 12,
200        const CXCompletionChunk_RightAngle = 13,
201        const CXCompletionChunk_Comma = 14,
202        const CXCompletionChunk_ResultType = 15,
203        const CXCompletionChunk_Colon = 16,
204        const CXCompletionChunk_SemiColon = 17,
205        const CXCompletionChunk_Equal = 18,
206        const CXCompletionChunk_HorizontalSpace = 19,
207        const CXCompletionChunk_VerticalSpace = 20,
208    }
209}
210
211cenum! {
212    enum CXCursorKind {
213        const CXCursor_UnexposedDecl = 1,
214        const CXCursor_StructDecl = 2,
215        const CXCursor_UnionDecl = 3,
216        const CXCursor_ClassDecl = 4,
217        const CXCursor_EnumDecl = 5,
218        const CXCursor_FieldDecl = 6,
219        const CXCursor_EnumConstantDecl = 7,
220        const CXCursor_FunctionDecl = 8,
221        const CXCursor_VarDecl = 9,
222        const CXCursor_ParmDecl = 10,
223        const CXCursor_ObjCInterfaceDecl = 11,
224        const CXCursor_ObjCCategoryDecl = 12,
225        const CXCursor_ObjCProtocolDecl = 13,
226        const CXCursor_ObjCPropertyDecl = 14,
227        const CXCursor_ObjCIvarDecl = 15,
228        const CXCursor_ObjCInstanceMethodDecl = 16,
229        const CXCursor_ObjCClassMethodDecl = 17,
230        const CXCursor_ObjCImplementationDecl = 18,
231        const CXCursor_ObjCCategoryImplDecl = 19,
232        const CXCursor_TypedefDecl = 20,
233        const CXCursor_CXXMethod = 21,
234        const CXCursor_Namespace = 22,
235        const CXCursor_LinkageSpec = 23,
236        const CXCursor_Constructor = 24,
237        const CXCursor_Destructor = 25,
238        const CXCursor_ConversionFunction = 26,
239        const CXCursor_TemplateTypeParameter = 27,
240        const CXCursor_NonTypeTemplateParameter = 28,
241        const CXCursor_TemplateTemplateParameter = 29,
242        const CXCursor_FunctionTemplate = 30,
243        const CXCursor_ClassTemplate = 31,
244        const CXCursor_ClassTemplatePartialSpecialization = 32,
245        const CXCursor_NamespaceAlias = 33,
246        const CXCursor_UsingDirective = 34,
247        const CXCursor_UsingDeclaration = 35,
248        const CXCursor_TypeAliasDecl = 36,
249        const CXCursor_ObjCSynthesizeDecl = 37,
250        const CXCursor_ObjCDynamicDecl = 38,
251        const CXCursor_CXXAccessSpecifier = 39,
252        const CXCursor_ObjCSuperClassRef = 40,
253        const CXCursor_ObjCProtocolRef = 41,
254        const CXCursor_ObjCClassRef = 42,
255        const CXCursor_TypeRef = 43,
256        const CXCursor_CXXBaseSpecifier = 44,
257        const CXCursor_TemplateRef = 45,
258        const CXCursor_NamespaceRef = 46,
259        const CXCursor_MemberRef = 47,
260        const CXCursor_LabelRef = 48,
261        const CXCursor_OverloadedDeclRef = 49,
262        const CXCursor_VariableRef = 50,
263        const CXCursor_InvalidFile = 70,
264        const CXCursor_NoDeclFound = 71,
265        const CXCursor_NotImplemented = 72,
266        const CXCursor_InvalidCode = 73,
267        const CXCursor_UnexposedExpr = 100,
268        const CXCursor_DeclRefExpr = 101,
269        const CXCursor_MemberRefExpr = 102,
270        const CXCursor_CallExpr = 103,
271        const CXCursor_ObjCMessageExpr = 104,
272        const CXCursor_BlockExpr = 105,
273        const CXCursor_IntegerLiteral = 106,
274        const CXCursor_FloatingLiteral = 107,
275        const CXCursor_ImaginaryLiteral = 108,
276        const CXCursor_StringLiteral = 109,
277        const CXCursor_CharacterLiteral = 110,
278        const CXCursor_ParenExpr = 111,
279        const CXCursor_UnaryOperator = 112,
280        const CXCursor_ArraySubscriptExpr = 113,
281        const CXCursor_BinaryOperator = 114,
282        const CXCursor_CompoundAssignOperator = 115,
283        const CXCursor_ConditionalOperator = 116,
284        const CXCursor_CStyleCastExpr = 117,
285        const CXCursor_CompoundLiteralExpr = 118,
286        const CXCursor_InitListExpr = 119,
287        const CXCursor_AddrLabelExpr = 120,
288        const CXCursor_StmtExpr = 121,
289        const CXCursor_GenericSelectionExpr = 122,
290        const CXCursor_GNUNullExpr = 123,
291        const CXCursor_CXXStaticCastExpr = 124,
292        const CXCursor_CXXDynamicCastExpr = 125,
293        const CXCursor_CXXReinterpretCastExpr = 126,
294        const CXCursor_CXXConstCastExpr = 127,
295        const CXCursor_CXXFunctionalCastExpr = 128,
296        const CXCursor_CXXTypeidExpr = 129,
297        const CXCursor_CXXBoolLiteralExpr = 130,
298        const CXCursor_CXXNullPtrLiteralExpr = 131,
299        const CXCursor_CXXThisExpr = 132,
300        const CXCursor_CXXThrowExpr = 133,
301        const CXCursor_CXXNewExpr = 134,
302        const CXCursor_CXXDeleteExpr = 135,
303        const CXCursor_UnaryExpr = 136,
304        const CXCursor_ObjCStringLiteral = 137,
305        const CXCursor_ObjCEncodeExpr = 138,
306        const CXCursor_ObjCSelectorExpr = 139,
307        const CXCursor_ObjCProtocolExpr = 140,
308        const CXCursor_ObjCBridgedCastExpr = 141,
309        const CXCursor_PackExpansionExpr = 142,
310        const CXCursor_SizeOfPackExpr = 143,
311        const CXCursor_LambdaExpr = 144,
312        const CXCursor_ObjCBoolLiteralExpr = 145,
313        const CXCursor_ObjCSelfExpr = 146,
314        /// Only produced by `libclang` 3.8 and later.
315        const CXCursor_OMPArraySectionExpr = 147,
316        /// Only produced by `libclang` 3.9 and later.
317        const CXCursor_ObjCAvailabilityCheckExpr = 148,
318        /// Only produced by `libclang` 7.0 and later.
319        const CXCursor_FixedPointLiteral = 149,
320        /// Only produced by `libclang` 12.0 and later.
321        const CXCursor_OMPArrayShapingExpr = 150,
322        /// Only produced by `libclang` 12.0 and later.
323        const CXCursor_OMPIteratorExpr = 151,
324        /// Only produced by `libclang` 12.0 and later.
325        const CXCursor_CXXAddrspaceCastExpr = 152,
326        /// Only produced by `libclang` 15.0 and later.
327        const CXCursor_ConceptSpecializationExpr = 153,
328        /// Only produced by `libclang` 15.0 and later.
329        const CXCursor_RequiresExpr = 154,
330        const CXCursor_UnexposedStmt = 200,
331        const CXCursor_LabelStmt = 201,
332        const CXCursor_CompoundStmt = 202,
333        const CXCursor_CaseStmt = 203,
334        const CXCursor_DefaultStmt = 204,
335        const CXCursor_IfStmt = 205,
336        const CXCursor_SwitchStmt = 206,
337        const CXCursor_WhileStmt = 207,
338        const CXCursor_DoStmt = 208,
339        const CXCursor_ForStmt = 209,
340        const CXCursor_GotoStmt = 210,
341        const CXCursor_IndirectGotoStmt = 211,
342        const CXCursor_ContinueStmt = 212,
343        const CXCursor_BreakStmt = 213,
344        const CXCursor_ReturnStmt = 214,
345        /// Duplicate of `CXCursor_GccAsmStmt`.
346        const CXCursor_AsmStmt = 215,
347        const CXCursor_ObjCAtTryStmt = 216,
348        const CXCursor_ObjCAtCatchStmt = 217,
349        const CXCursor_ObjCAtFinallyStmt = 218,
350        const CXCursor_ObjCAtThrowStmt = 219,
351        const CXCursor_ObjCAtSynchronizedStmt = 220,
352        const CXCursor_ObjCAutoreleasePoolStmt = 221,
353        const CXCursor_ObjCForCollectionStmt = 222,
354        const CXCursor_CXXCatchStmt = 223,
355        const CXCursor_CXXTryStmt = 224,
356        const CXCursor_CXXForRangeStmt = 225,
357        const CXCursor_SEHTryStmt = 226,
358        const CXCursor_SEHExceptStmt = 227,
359        const CXCursor_SEHFinallyStmt = 228,
360        const CXCursor_MSAsmStmt = 229,
361        const CXCursor_NullStmt = 230,
362        const CXCursor_DeclStmt = 231,
363        const CXCursor_OMPParallelDirective = 232,
364        const CXCursor_OMPSimdDirective = 233,
365        const CXCursor_OMPForDirective = 234,
366        const CXCursor_OMPSectionsDirective = 235,
367        const CXCursor_OMPSectionDirective = 236,
368        const CXCursor_OMPSingleDirective = 237,
369        const CXCursor_OMPParallelForDirective = 238,
370        const CXCursor_OMPParallelSectionsDirective = 239,
371        const CXCursor_OMPTaskDirective = 240,
372        const CXCursor_OMPMasterDirective = 241,
373        const CXCursor_OMPCriticalDirective = 242,
374        const CXCursor_OMPTaskyieldDirective = 243,
375        const CXCursor_OMPBarrierDirective = 244,
376        const CXCursor_OMPTaskwaitDirective = 245,
377        const CXCursor_OMPFlushDirective = 246,
378        const CXCursor_SEHLeaveStmt = 247,
379        /// Only produced by `libclang` 3.6 and later.
380        const CXCursor_OMPOrderedDirective = 248,
381        /// Only produced by `libclang` 3.6 and later.
382        const CXCursor_OMPAtomicDirective = 249,
383        /// Only produced by `libclang` 3.6 and later.
384        const CXCursor_OMPForSimdDirective = 250,
385        /// Only produced by `libclang` 3.6 and later.
386        const CXCursor_OMPParallelForSimdDirective = 251,
387        /// Only produced by `libclang` 3.6 and later.
388        const CXCursor_OMPTargetDirective = 252,
389        /// Only produced by `libclang` 3.6 and later.
390        const CXCursor_OMPTeamsDirective = 253,
391        /// Only produced by `libclang` 3.7 and later.
392        const CXCursor_OMPTaskgroupDirective = 254,
393        /// Only produced by `libclang` 3.7 and later.
394        const CXCursor_OMPCancellationPointDirective = 255,
395        /// Only produced by `libclang` 3.7 and later.
396        const CXCursor_OMPCancelDirective = 256,
397        /// Only produced by `libclang` 3.8 and later.
398        const CXCursor_OMPTargetDataDirective = 257,
399        /// Only produced by `libclang` 3.8 and later.
400        const CXCursor_OMPTaskLoopDirective = 258,
401        /// Only produced by `libclang` 3.8 and later.
402        const CXCursor_OMPTaskLoopSimdDirective = 259,
403        /// Only produced by `libclang` 3.8 and later.
404        const CXCursor_OMPDistributeDirective = 260,
405        /// Only produced by `libclang` 3.9 and later.
406        const CXCursor_OMPTargetEnterDataDirective = 261,
407        /// Only produced by `libclang` 3.9 and later.
408        const CXCursor_OMPTargetExitDataDirective = 262,
409        /// Only produced by `libclang` 3.9 and later.
410        const CXCursor_OMPTargetParallelDirective = 263,
411        /// Only produced by `libclang` 3.9 and later.
412        const CXCursor_OMPTargetParallelForDirective = 264,
413        /// Only produced by `libclang` 3.9 and later.
414        const CXCursor_OMPTargetUpdateDirective = 265,
415        /// Only produced by `libclang` 3.9 and later.
416        const CXCursor_OMPDistributeParallelForDirective = 266,
417        /// Only produced by `libclang` 3.9 and later.
418        const CXCursor_OMPDistributeParallelForSimdDirective = 267,
419        /// Only produced by `libclang` 3.9 and later.
420        const CXCursor_OMPDistributeSimdDirective = 268,
421        /// Only produced by `libclang` 3.9 and later.
422        const CXCursor_OMPTargetParallelForSimdDirective = 269,
423        /// Only produced by `libclang` 4.0 and later.
424        const CXCursor_OMPTargetSimdDirective = 270,
425        /// Only produced by `libclang` 4.0 and later.
426        const CXCursor_OMPTeamsDistributeDirective = 271,
427        /// Only produced by `libclang` 4.0 and later.
428        const CXCursor_OMPTeamsDistributeSimdDirective = 272,
429        /// Only produced by `libclang` 4.0 and later.
430        const CXCursor_OMPTeamsDistributeParallelForSimdDirective = 273,
431        /// Only produced by `libclang` 4.0 and later.
432        const CXCursor_OMPTeamsDistributeParallelForDirective = 274,
433        /// Only produced by `libclang` 4.0 and later.
434        const CXCursor_OMPTargetTeamsDirective = 275,
435        /// Only produced by `libclang` 4.0 and later.
436        const CXCursor_OMPTargetTeamsDistributeDirective = 276,
437        /// Only produced by `libclang` 4.0 and later.
438        const CXCursor_OMPTargetTeamsDistributeParallelForDirective = 277,
439        /// Only produced by `libclang` 4.0 and later.
440        const CXCursor_OMPTargetTeamsDistributeParallelForSimdDirective = 278,
441        /// Only producer by `libclang` 4.0 and later.
442        const CXCursor_OMPTargetTeamsDistributeSimdDirective = 279,
443        /// Only produced by 'libclang' 9.0 and later.
444        const CXCursor_BuiltinBitCastExpr = 280,
445        /// Only produced by `libclang` 10.0 and later.
446        const CXCursor_OMPMasterTaskLoopDirective = 281,
447        /// Only produced by `libclang` 10.0 and later.
448        const CXCursor_OMPParallelMasterTaskLoopDirective = 282,
449        /// Only produced by `libclang` 10.0 and later.
450        const CXCursor_OMPMasterTaskLoopSimdDirective = 283,
451        /// Only produced by `libclang` 10.0 and later.
452        const CXCursor_OMPParallelMasterTaskLoopSimdDirective = 284,
453        /// Only produced by `libclang` 10.0 and later.
454        const CXCursor_OMPParallelMasterDirective = 285,
455        /// Only produced by `libclang` 11.0 and later.
456        const CXCursor_OMPDepobjDirective = 286,
457        /// Only produced by `libclang` 11.0 and later.
458        const CXCursor_OMPScanDirective = 287,
459        /// Only produced by `libclang` 13.0 and later.
460        const CXCursor_OMPTileDirective = 288,
461        /// Only produced by `libclang` 13.0 and later.
462        const CXCursor_OMPCanonicalLoop = 289,
463        /// Only produced by `libclang` 13.0 and later.
464        const CXCursor_OMPInteropDirective = 290,
465        /// Only produced by `libclang` 13.0 and later.
466        const CXCursor_OMPDispatchDirective = 291,
467        /// Only produced by `libclang` 13.0 and later.
468        const CXCursor_OMPMaskedDirective = 292,
469        /// Only produced by `libclang` 13.0 and later.
470        const CXCursor_OMPUnrollDirective = 293,
471        /// Only produced by `libclang` 14.0 and later.
472        const CXCursor_OMPMetaDirective = 294,
473        /// Only produced by `libclang` 14.0 and later.
474        const CXCursor_OMPGenericLoopDirective = 295,
475        /// Only produced by `libclang` 15.0 and later.
476        const CXCursor_OMPTeamsGenericLoopDirective = 296,
477        /// Only produced by `libclang` 15.0 and later.
478        const CXCursor_OMPTargetTeamsGenericLoopDirective = 297,
479        /// Only produced by `libclang` 15.0 and later.
480        const CXCursor_OMPParallelGenericLoopDirective = 298,
481        /// Only produced by `libclang` 15.0 and later.
482        const CXCursor_OMPTargetParallelGenericLoopDirective = 299,
483        /// Only produced by `libclang` 15.0 and later.
484        const CXCursor_OMPParallelMaskedDirective = 300,
485        /// Only produced by `libclang` 15.0 and later.
486        const CXCursor_OMPMaskedTaskLoopDirective = 301,
487        /// Only produced by `libclang` 15.0 and later.
488        const CXCursor_OMPMaskedTaskLoopSimdDirective = 302,
489        /// Only produced by `libclang` 15.0 and later.
490        const CXCursor_OMPParallelMaskedTaskLoopDirective = 303,
491        /// Only produced by `libclang` 15.0 and later.
492        const CXCursor_OMPParallelMaskedTaskLoopSimdDirective = 304,
493        #[cfg(not(feature="clang_15_0"))]
494        const CXCursor_TranslationUnit = 300,
495        #[cfg(feature="clang_15_0")]
496        const CXCursor_TranslationUnit = 350,
497        const CXCursor_UnexposedAttr = 400,
498        const CXCursor_IBActionAttr = 401,
499        const CXCursor_IBOutletAttr = 402,
500        const CXCursor_IBOutletCollectionAttr = 403,
501        const CXCursor_CXXFinalAttr = 404,
502        const CXCursor_CXXOverrideAttr = 405,
503        const CXCursor_AnnotateAttr = 406,
504        const CXCursor_AsmLabelAttr = 407,
505        const CXCursor_PackedAttr = 408,
506        const CXCursor_PureAttr = 409,
507        const CXCursor_ConstAttr = 410,
508        const CXCursor_NoDuplicateAttr = 411,
509        const CXCursor_CUDAConstantAttr = 412,
510        const CXCursor_CUDADeviceAttr = 413,
511        const CXCursor_CUDAGlobalAttr = 414,
512        const CXCursor_CUDAHostAttr = 415,
513        /// Only produced by `libclang` 3.6 and later.
514        const CXCursor_CUDASharedAttr = 416,
515        /// Only produced by `libclang` 3.8 and later.
516        const CXCursor_VisibilityAttr = 417,
517        /// Only produced by `libclang` 3.8 and later.
518        const CXCursor_DLLExport = 418,
519        /// Only produced by `libclang` 3.8 and later.
520        const CXCursor_DLLImport = 419,
521        /// Only produced by `libclang` 8.0 and later.
522        const CXCursor_NSReturnsRetained = 420,
523        /// Only produced by `libclang` 8.0 and later.
524        const CXCursor_NSReturnsNotRetained = 421,
525        /// Only produced by `libclang` 8.0 and later.
526        const CXCursor_NSReturnsAutoreleased = 422,
527        /// Only produced by `libclang` 8.0 and later.
528        const CXCursor_NSConsumesSelf = 423,
529        /// Only produced by `libclang` 8.0 and later.
530        const CXCursor_NSConsumed = 424,
531        /// Only produced by `libclang` 8.0 and later.
532        const CXCursor_ObjCException = 425,
533        /// Only produced by `libclang` 8.0 and later.
534        const CXCursor_ObjCNSObject = 426,
535        /// Only produced by `libclang` 8.0 and later.
536        const CXCursor_ObjCIndependentClass = 427,
537        /// Only produced by `libclang` 8.0 and later.
538        const CXCursor_ObjCPreciseLifetime = 428,
539        /// Only produced by `libclang` 8.0 and later.
540        const CXCursor_ObjCReturnsInnerPointer = 429,
541        /// Only produced by `libclang` 8.0 and later.
542        const CXCursor_ObjCRequiresSuper = 430,
543        /// Only produced by `libclang` 8.0 and later.
544        const CXCursor_ObjCRootClass = 431,
545        /// Only produced by `libclang` 8.0 and later.
546        const CXCursor_ObjCSubclassingRestricted = 432,
547        /// Only produced by `libclang` 8.0 and later.
548        const CXCursor_ObjCExplicitProtocolImpl = 433,
549        /// Only produced by `libclang` 8.0 and later.
550        const CXCursor_ObjCDesignatedInitializer = 434,
551        /// Only produced by `libclang` 8.0 and later.
552        const CXCursor_ObjCRuntimeVisible = 435,
553        /// Only produced by `libclang` 8.0 and later.
554        const CXCursor_ObjCBoxable = 436,
555        /// Only produced by `libclang` 8.0 and later.
556        const CXCursor_FlagEnum = 437,
557        /// Only produced by `libclang` 9.0 and later.
558        const CXCursor_ConvergentAttr  = 438,
559        /// Only produced by `libclang` 9.0 and later.
560        const CXCursor_WarnUnusedAttr = 439,
561        /// Only produced by `libclang` 9.0 and later.
562        const CXCursor_WarnUnusedResultAttr = 440,
563        /// Only produced by `libclang` 9.0 and later.
564        const CXCursor_AlignedAttr = 441,
565        const CXCursor_PreprocessingDirective = 500,
566        const CXCursor_MacroDefinition = 501,
567        /// Duplicate of `CXCursor_MacroInstantiation`.
568        const CXCursor_MacroExpansion = 502,
569        const CXCursor_InclusionDirective = 503,
570        const CXCursor_ModuleImportDecl = 600,
571        /// Only produced by `libclang` 3.8 and later.
572        const CXCursor_TypeAliasTemplateDecl = 601,
573        /// Only produced by `libclang` 3.9 and later.
574        const CXCursor_StaticAssert = 602,
575        /// Only produced by `libclang` 4.0 and later.
576        const CXCursor_FriendDecl = 603,
577        /// Only produced by `libclang` 15.0 and later.
578        const CXCursor_ConceptDecl = 604,
579        /// Only produced by `libclang` 3.7 and later.
580        const CXCursor_OverloadCandidate = 700,
581    }
582}
583
584cenum! {
585    /// Only available on `libclang` 5.0 and later.
586    #[cfg(feature = "clang_5_0")]
587    enum CXCursor_ExceptionSpecificationKind {
588        const CXCursor_ExceptionSpecificationKind_None = 0,
589        const CXCursor_ExceptionSpecificationKind_DynamicNone = 1,
590        const CXCursor_ExceptionSpecificationKind_Dynamic = 2,
591        const CXCursor_ExceptionSpecificationKind_MSAny = 3,
592        const CXCursor_ExceptionSpecificationKind_BasicNoexcept = 4,
593        const CXCursor_ExceptionSpecificationKind_ComputedNoexcept = 5,
594        const CXCursor_ExceptionSpecificationKind_Unevaluated = 6,
595        const CXCursor_ExceptionSpecificationKind_Uninstantiated = 7,
596        const CXCursor_ExceptionSpecificationKind_Unparsed = 8,
597        /// Only available on `libclang` 9.0 and later.
598        #[cfg(feature = "clang_9_0")]
599        const CXCursor_ExceptionSpecificationKind_NoThrow = 9,
600    }
601}
602
603cenum! {
604    enum CXDiagnosticSeverity {
605        const CXDiagnostic_Ignored = 0,
606        const CXDiagnostic_Note = 1,
607        const CXDiagnostic_Warning = 2,
608        const CXDiagnostic_Error = 3,
609        const CXDiagnostic_Fatal = 4,
610    }
611}
612
613cenum! {
614    enum CXErrorCode {
615        const CXError_Success = 0,
616        const CXError_Failure = 1,
617        const CXError_Crashed = 2,
618        const CXError_InvalidArguments = 3,
619        const CXError_ASTReadError = 4,
620    }
621}
622
623cenum! {
624    enum CXEvalResultKind {
625        const CXEval_UnExposed = 0,
626        const CXEval_Int = 1 ,
627        const CXEval_Float = 2,
628        const CXEval_ObjCStrLiteral = 3,
629        const CXEval_StrLiteral = 4,
630        const CXEval_CFStr = 5,
631        const CXEval_Other = 6,
632    }
633}
634
635cenum! {
636    enum CXIdxAttrKind {
637        const CXIdxAttr_Unexposed = 0,
638        const CXIdxAttr_IBAction = 1,
639        const CXIdxAttr_IBOutlet = 2,
640        const CXIdxAttr_IBOutletCollection = 3,
641    }
642}
643
644cenum! {
645    enum CXIdxEntityCXXTemplateKind {
646        const CXIdxEntity_NonTemplate = 0,
647        const CXIdxEntity_Template = 1,
648        const CXIdxEntity_TemplatePartialSpecialization = 2,
649        const CXIdxEntity_TemplateSpecialization = 3,
650    }
651}
652
653cenum! {
654    enum CXIdxEntityKind {
655        const CXIdxEntity_Unexposed = 0,
656        const CXIdxEntity_Typedef = 1,
657        const CXIdxEntity_Function = 2,
658        const CXIdxEntity_Variable = 3,
659        const CXIdxEntity_Field = 4,
660        const CXIdxEntity_EnumConstant = 5,
661        const CXIdxEntity_ObjCClass = 6,
662        const CXIdxEntity_ObjCProtocol = 7,
663        const CXIdxEntity_ObjCCategory = 8,
664        const CXIdxEntity_ObjCInstanceMethod = 9,
665        const CXIdxEntity_ObjCClassMethod = 10,
666        const CXIdxEntity_ObjCProperty = 11,
667        const CXIdxEntity_ObjCIvar = 12,
668        const CXIdxEntity_Enum = 13,
669        const CXIdxEntity_Struct = 14,
670        const CXIdxEntity_Union = 15,
671        const CXIdxEntity_CXXClass = 16,
672        const CXIdxEntity_CXXNamespace = 17,
673        const CXIdxEntity_CXXNamespaceAlias = 18,
674        const CXIdxEntity_CXXStaticVariable = 19,
675        const CXIdxEntity_CXXStaticMethod = 20,
676        const CXIdxEntity_CXXInstanceMethod = 21,
677        const CXIdxEntity_CXXConstructor = 22,
678        const CXIdxEntity_CXXDestructor = 23,
679        const CXIdxEntity_CXXConversionFunction = 24,
680        const CXIdxEntity_CXXTypeAlias = 25,
681        const CXIdxEntity_CXXInterface = 26,
682        /// Only produced by `libclang` 15.0 and later.
683        const CXIdxEntity_CXXConcept = 27,
684    }
685}
686
687cenum! {
688    enum CXIdxEntityLanguage {
689        const CXIdxEntityLang_None = 0,
690        const CXIdxEntityLang_C = 1,
691        const CXIdxEntityLang_ObjC = 2,
692        const CXIdxEntityLang_CXX = 3,
693        /// Only produced by `libclang` 5.0 and later.
694        const CXIdxEntityLang_Swift = 4,
695    }
696}
697
698cenum! {
699    enum CXIdxEntityRefKind {
700        const CXIdxEntityRef_Direct = 1,
701        const CXIdxEntityRef_Implicit = 2,
702    }
703}
704
705cenum! {
706    enum CXIdxObjCContainerKind {
707        const CXIdxObjCContainer_ForwardRef = 0,
708        const CXIdxObjCContainer_Interface = 1,
709        const CXIdxObjCContainer_Implementation = 2,
710    }
711}
712
713cenum! {
714    enum CXLanguageKind {
715        const CXLanguage_Invalid = 0,
716        const CXLanguage_C = 1,
717        const CXLanguage_ObjC = 2,
718        const CXLanguage_CPlusPlus = 3,
719    }
720}
721
722cenum! {
723    enum CXLinkageKind {
724        const CXLinkage_Invalid = 0,
725        const CXLinkage_NoLinkage = 1,
726        const CXLinkage_Internal = 2,
727        const CXLinkage_UniqueExternal = 3,
728        const CXLinkage_External = 4,
729    }
730}
731
732cenum! {
733    enum CXLoadDiag_Error {
734        const CXLoadDiag_None = 0,
735        const CXLoadDiag_Unknown = 1,
736        const CXLoadDiag_CannotLoad = 2,
737        const CXLoadDiag_InvalidFile = 3,
738    }
739}
740
741cenum! {
742    /// Only available on `libclang` 7.0 and later.
743    #[cfg(feature = "clang_7_0")]
744    enum CXPrintingPolicyProperty {
745        const CXPrintingPolicy_Indentation = 0,
746        const CXPrintingPolicy_SuppressSpecifiers = 1,
747        const CXPrintingPolicy_SuppressTagKeyword = 2,
748        const CXPrintingPolicy_IncludeTagDefinition = 3,
749        const CXPrintingPolicy_SuppressScope = 4,
750        const CXPrintingPolicy_SuppressUnwrittenScope = 5,
751        const CXPrintingPolicy_SuppressInitializers = 6,
752        const CXPrintingPolicy_ConstantArraySizeAsWritten = 7,
753        const CXPrintingPolicy_AnonymousTagLocations = 8,
754        const CXPrintingPolicy_SuppressStrongLifetime = 9,
755        const CXPrintingPolicy_SuppressLifetimeQualifiers = 10,
756        const CXPrintingPolicy_SuppressTemplateArgsInCXXConstructors = 11,
757        const CXPrintingPolicy_Bool = 12,
758        const CXPrintingPolicy_Restrict = 13,
759        const CXPrintingPolicy_Alignof = 14,
760        const CXPrintingPolicy_UnderscoreAlignof = 15,
761        const CXPrintingPolicy_UseVoidForZeroParams = 16,
762        const CXPrintingPolicy_TerseOutput = 17,
763        const CXPrintingPolicy_PolishForDeclaration = 18,
764        const CXPrintingPolicy_Half = 19,
765        const CXPrintingPolicy_MSWChar = 20,
766        const CXPrintingPolicy_IncludeNewlines = 21,
767        const CXPrintingPolicy_MSVCFormatting = 22,
768        const CXPrintingPolicy_ConstantsAsWritten = 23,
769        const CXPrintingPolicy_SuppressImplicitBase = 24,
770        const CXPrintingPolicy_FullyQualifiedName = 25,
771    }
772}
773
774cenum! {
775    enum CXRefQualifierKind {
776        const CXRefQualifier_None = 0,
777        const CXRefQualifier_LValue = 1,
778        const CXRefQualifier_RValue = 2,
779    }
780}
781
782cenum! {
783    enum CXResult {
784        const CXResult_Success = 0,
785        const CXResult_Invalid = 1,
786        const CXResult_VisitBreak = 2,
787    }
788}
789
790cenum! {
791    enum CXSaveError {
792        const CXSaveError_None = 0,
793        const CXSaveError_Unknown = 1,
794        const CXSaveError_TranslationErrors = 2,
795        const CXSaveError_InvalidTU = 3,
796    }
797}
798
799cenum! {
800    /// Only available on `libclang` 6.0 and later.
801    #[cfg(feature = "clang_6_0")]
802    enum CXTLSKind {
803        const CXTLS_None = 0,
804        const CXTLS_Dynamic = 1,
805        const CXTLS_Static = 2,
806    }
807}
808
809cenum! {
810    enum CXTUResourceUsageKind {
811        const CXTUResourceUsage_AST = 1,
812        const CXTUResourceUsage_Identifiers = 2,
813        const CXTUResourceUsage_Selectors = 3,
814        const CXTUResourceUsage_GlobalCompletionResults = 4,
815        const CXTUResourceUsage_SourceManagerContentCache = 5,
816        const CXTUResourceUsage_AST_SideTables = 6,
817        const CXTUResourceUsage_SourceManager_Membuffer_Malloc = 7,
818        const CXTUResourceUsage_SourceManager_Membuffer_MMap = 8,
819        const CXTUResourceUsage_ExternalASTSource_Membuffer_Malloc = 9,
820        const CXTUResourceUsage_ExternalASTSource_Membuffer_MMap = 10,
821        const CXTUResourceUsage_Preprocessor = 11,
822        const CXTUResourceUsage_PreprocessingRecord = 12,
823        const CXTUResourceUsage_SourceManager_DataStructures = 13,
824        const CXTUResourceUsage_Preprocessor_HeaderSearch = 14,
825    }
826}
827
828cenum! {
829    /// Only available on `libclang` 3.6 and later.
830    #[cfg(feature = "clang_3_6")]
831    enum CXTemplateArgumentKind {
832        const CXTemplateArgumentKind_Null = 0,
833        const CXTemplateArgumentKind_Type = 1,
834        const CXTemplateArgumentKind_Declaration = 2,
835        const CXTemplateArgumentKind_NullPtr = 3,
836        const CXTemplateArgumentKind_Integral = 4,
837        const CXTemplateArgumentKind_Template = 5,
838        const CXTemplateArgumentKind_TemplateExpansion = 6,
839        const CXTemplateArgumentKind_Expression = 7,
840        const CXTemplateArgumentKind_Pack = 8,
841        const CXTemplateArgumentKind_Invalid = 9,
842    }
843}
844
845cenum! {
846    enum CXTokenKind {
847        const CXToken_Punctuation = 0,
848        const CXToken_Keyword = 1,
849        const CXToken_Identifier = 2,
850        const CXToken_Literal = 3,
851        const CXToken_Comment = 4,
852    }
853}
854
855cenum! {
856    enum CXTypeKind {
857        const CXType_Invalid = 0,
858        const CXType_Unexposed = 1,
859        const CXType_Void = 2,
860        const CXType_Bool = 3,
861        const CXType_Char_U = 4,
862        const CXType_UChar = 5,
863        const CXType_Char16 = 6,
864        const CXType_Char32 = 7,
865        const CXType_UShort = 8,
866        const CXType_UInt = 9,
867        const CXType_ULong = 10,
868        const CXType_ULongLong = 11,
869        const CXType_UInt128 = 12,
870        const CXType_Char_S = 13,
871        const CXType_SChar = 14,
872        const CXType_WChar = 15,
873        const CXType_Short = 16,
874        const CXType_Int = 17,
875        const CXType_Long = 18,
876        const CXType_LongLong = 19,
877        const CXType_Int128 = 20,
878        const CXType_Float = 21,
879        const CXType_Double = 22,
880        const CXType_LongDouble = 23,
881        const CXType_NullPtr = 24,
882        const CXType_Overload = 25,
883        const CXType_Dependent = 26,
884        const CXType_ObjCId = 27,
885        const CXType_ObjCClass = 28,
886        const CXType_ObjCSel = 29,
887        /// Only produced by `libclang` 3.9 and later.
888        const CXType_Float128 = 30,
889        /// Only produced by `libclang` 5.0 and later.
890        const CXType_Half = 31,
891        /// Only produced by `libclang` 6.0 and later.
892        const CXType_Float16 = 32,
893        /// Only produced by `libclang` 7.0 and later.
894        const CXType_ShortAccum = 33,
895        /// Only produced by `libclang` 7.0 and later.
896        const CXType_Accum = 34,
897        /// Only produced by `libclang` 7.0 and later.
898        const CXType_LongAccum = 35,
899        /// Only produced by `libclang` 7.0 and later.
900        const CXType_UShortAccum = 36,
901        /// Only produced by `libclang` 7.0 and later.
902        const CXType_UAccum = 37,
903        /// Only produced by `libclang` 7.0 and later.
904        const CXType_ULongAccum = 38,
905        /// Only produced by `libclang` 11.0 and later.
906        const CXType_BFloat16 = 39,
907        /// Only produced by `libclang` 14.0 and later.
908        const CXType_Ibm128 = 40,
909        const CXType_Complex = 100,
910        const CXType_Pointer = 101,
911        const CXType_BlockPointer = 102,
912        const CXType_LValueReference = 103,
913        const CXType_RValueReference = 104,
914        const CXType_Record = 105,
915        const CXType_Enum = 106,
916        const CXType_Typedef = 107,
917        const CXType_ObjCInterface = 108,
918        const CXType_ObjCObjectPointer = 109,
919        const CXType_FunctionNoProto = 110,
920        const CXType_FunctionProto = 111,
921        const CXType_ConstantArray = 112,
922        const CXType_Vector = 113,
923        const CXType_IncompleteArray = 114,
924        const CXType_VariableArray = 115,
925        const CXType_DependentSizedArray = 116,
926        const CXType_MemberPointer = 117,
927        /// Only produced by `libclang` 3.8 and later.
928        const CXType_Auto = 118,
929        /// Only produced by `libclang` 3.9 and later.
930        const CXType_Elaborated = 119,
931        /// Only produced by `libclang` 5.0 and later.
932        const CXType_Pipe = 120,
933        /// Only produced by `libclang` 5.0 and later.
934        const CXType_OCLImage1dRO = 121,
935        /// Only produced by `libclang` 5.0 and later.
936        const CXType_OCLImage1dArrayRO = 122,
937        /// Only produced by `libclang` 5.0 and later.
938        const CXType_OCLImage1dBufferRO = 123,
939        /// Only produced by `libclang` 5.0 and later.
940        const CXType_OCLImage2dRO = 124,
941        /// Only produced by `libclang` 5.0 and later.
942        const CXType_OCLImage2dArrayRO = 125,
943        /// Only produced by `libclang` 5.0 and later.
944        const CXType_OCLImage2dDepthRO = 126,
945        /// Only produced by `libclang` 5.0 and later.
946        const CXType_OCLImage2dArrayDepthRO = 127,
947        /// Only produced by `libclang` 5.0 and later.
948        const CXType_OCLImage2dMSAARO = 128,
949        /// Only produced by `libclang` 5.0 and later.
950        const CXType_OCLImage2dArrayMSAARO = 129,
951        /// Only produced by `libclang` 5.0 and later.
952        const CXType_OCLImage2dMSAADepthRO = 130,
953        /// Only produced by `libclang` 5.0 and later.
954        const CXType_OCLImage2dArrayMSAADepthRO = 131,
955        /// Only produced by `libclang` 5.0 and later.
956        const CXType_OCLImage3dRO = 132,
957        /// Only produced by `libclang` 5.0 and later.
958        const CXType_OCLImage1dWO = 133,
959        /// Only produced by `libclang` 5.0 and later.
960        const CXType_OCLImage1dArrayWO = 134,
961        /// Only produced by `libclang` 5.0 and later.
962        const CXType_OCLImage1dBufferWO = 135,
963        /// Only produced by `libclang` 5.0 and later.
964        const CXType_OCLImage2dWO = 136,
965        /// Only produced by `libclang` 5.0 and later.
966        const CXType_OCLImage2dArrayWO = 137,
967        /// Only produced by `libclang` 5.0 and later.
968        const CXType_OCLImage2dDepthWO = 138,
969        /// Only produced by `libclang` 5.0 and later.
970        const CXType_OCLImage2dArrayDepthWO = 139,
971        /// Only produced by `libclang` 5.0 and later.
972        const CXType_OCLImage2dMSAAWO = 140,
973        /// Only produced by `libclang` 5.0 and later.
974        const CXType_OCLImage2dArrayMSAAWO = 141,
975        /// Only produced by `libclang` 5.0 and later.
976        const CXType_OCLImage2dMSAADepthWO = 142,
977        /// Only produced by `libclang` 5.0 and later.
978        const CXType_OCLImage2dArrayMSAADepthWO = 143,
979        /// Only produced by `libclang` 5.0 and later.
980        const CXType_OCLImage3dWO = 144,
981        /// Only produced by `libclang` 5.0 and later.
982        const CXType_OCLImage1dRW = 145,
983        /// Only produced by `libclang` 5.0 and later.
984        const CXType_OCLImage1dArrayRW = 146,
985        /// Only produced by `libclang` 5.0 and later.
986        const CXType_OCLImage1dBufferRW = 147,
987        /// Only produced by `libclang` 5.0 and later.
988        const CXType_OCLImage2dRW = 148,
989        /// Only produced by `libclang` 5.0 and later.
990        const CXType_OCLImage2dArrayRW = 149,
991        /// Only produced by `libclang` 5.0 and later.
992        const CXType_OCLImage2dDepthRW = 150,
993        /// Only produced by `libclang` 5.0 and later.
994        const CXType_OCLImage2dArrayDepthRW = 151,
995        /// Only produced by `libclang` 5.0 and later.
996        const CXType_OCLImage2dMSAARW = 152,
997        /// Only produced by `libclang` 5.0 and later.
998        const CXType_OCLImage2dArrayMSAARW = 153,
999        /// Only produced by `libclang` 5.0 and later.
1000        const CXType_OCLImage2dMSAADepthRW = 154,
1001        /// Only produced by `libclang` 5.0 and later.
1002        const CXType_OCLImage2dArrayMSAADepthRW = 155,
1003        /// Only produced by `libclang` 5.0 and later.
1004        const CXType_OCLImage3dRW = 156,
1005        /// Only produced by `libclang` 5.0 and later.
1006        const CXType_OCLSampler = 157,
1007        /// Only produced by `libclang` 5.0 and later.
1008        const CXType_OCLEvent = 158,
1009        /// Only produced by `libclang` 5.0 and later.
1010        const CXType_OCLQueue = 159,
1011        /// Only produced by `libclang` 5.0 and later.
1012        const CXType_OCLReserveID = 160,
1013        /// Only produced by `libclang` 8.0 and later.
1014        const CXType_ObjCObject = 161,
1015        /// Only produced by `libclang` 8.0 and later.
1016        const CXType_ObjCTypeParam = 162,
1017        /// Only produced by `libclang` 8.0 and later.
1018        const CXType_Attributed = 163,
1019        /// Only produced by `libclang` 8.0 and later.
1020        const CXType_OCLIntelSubgroupAVCMcePayload = 164,
1021        /// Only produced by `libclang` 8.0 and later.
1022        const CXType_OCLIntelSubgroupAVCImePayload = 165,
1023        /// Only produced by `libclang` 8.0 and later.
1024        const CXType_OCLIntelSubgroupAVCRefPayload = 166,
1025        /// Only produced by `libclang` 8.0 and later.
1026        const CXType_OCLIntelSubgroupAVCSicPayload = 167,
1027        /// Only produced by `libclang` 8.0 and later.
1028        const CXType_OCLIntelSubgroupAVCMceResult = 168,
1029        /// Only produced by `libclang` 8.0 and later.
1030        const CXType_OCLIntelSubgroupAVCImeResult = 169,
1031        /// Only produced by `libclang` 8.0 and later.
1032        const CXType_OCLIntelSubgroupAVCRefResult = 170,
1033        /// Only produced by `libclang` 8.0 and later.
1034        const CXType_OCLIntelSubgroupAVCSicResult = 171,
1035        /// Only produced by `libclang` 8.0 and later.
1036        const CXType_OCLIntelSubgroupAVCImeResultSingleRefStreamout = 172,
1037        /// Only produced by `libclang` 8.0 and later.
1038        const CXType_OCLIntelSubgroupAVCImeResultDualRefStreamout = 173,
1039        /// Only produced by `libclang` 8.0 and later.
1040        const CXType_OCLIntelSubgroupAVCImeSingleRefStreamin = 174,
1041        /// Only produced by `libclang` 8.0 and later.
1042        const CXType_OCLIntelSubgroupAVCImeDualRefStreamin = 175,
1043        /// Only produced by `libclang` 9.0 and later.
1044        const CXType_ExtVector = 176,
1045        /// Only produced by `libclang` 11.0 and later.
1046        const CXType_Atomic = 177,
1047        /// Only produced by `libclang` 15.0 and later.
1048        const CXType_BTFTagAttributed = 178,
1049    }
1050}
1051
1052cenum! {
1053    enum CXTypeLayoutError {
1054        const CXTypeLayoutError_Invalid = -1,
1055        const CXTypeLayoutError_Incomplete = -2,
1056        const CXTypeLayoutError_Dependent = -3,
1057        const CXTypeLayoutError_NotConstantSize = -4,
1058        const CXTypeLayoutError_InvalidFieldName = -5,
1059        /// Only produced by `libclang` 9.0 and later.
1060        const CXTypeLayoutError_Undeduced = -6,
1061    }
1062}
1063
1064cenum! {
1065    /// Only available on `libclang` 3.8 and later.
1066    #[cfg(feature = "clang_3_8")]
1067    enum CXVisibilityKind {
1068        const CXVisibility_Invalid = 0,
1069        const CXVisibility_Hidden = 1,
1070        const CXVisibility_Protected = 2,
1071        const CXVisibility_Default = 3,
1072    }
1073}
1074
1075cenum! {
1076    /// Only available on `libclang` 8.0 and later.
1077    #[cfg(feature = "clang_8_0")]
1078    enum CXTypeNullabilityKind {
1079        const CXTypeNullability_NonNull = 0,
1080        const CXTypeNullability_Nullable = 1,
1081        const CXTypeNullability_Unspecified = 2,
1082        const CXTypeNullability_Invalid = 3,
1083        /// Only produced by `libclang` 12.0 and later.
1084        const CXTypeNullability_NullableResult = 4,
1085    }
1086}
1087
1088cenum! {
1089    enum CXVisitorResult {
1090        const CXVisit_Break = 0,
1091        const CXVisit_Continue = 1,
1092    }
1093}
1094
1095cenum! {
1096    enum CX_CXXAccessSpecifier {
1097        const CX_CXXInvalidAccessSpecifier = 0,
1098        const CX_CXXPublic = 1,
1099        const CX_CXXProtected = 2,
1100        const CX_CXXPrivate = 3,
1101    }
1102}
1103
1104cenum! {
1105    /// Only available on `libclang` 3.6 and later.
1106    #[cfg(feature = "clang_3_6")]
1107    enum CX_StorageClass {
1108        const CX_SC_Invalid = 0,
1109        const CX_SC_None = 1,
1110        const CX_SC_Extern = 2,
1111        const CX_SC_Static = 3,
1112        const CX_SC_PrivateExtern = 4,
1113        const CX_SC_OpenCLWorkGroupLocal = 5,
1114        const CX_SC_Auto = 6,
1115        const CX_SC_Register = 7,
1116    }
1117}
1118
1119//================================================
1120// Flags
1121//================================================
1122
1123cenum! {
1124    enum CXCodeComplete_Flags {
1125        const CXCodeComplete_IncludeMacros = 1;
1126        const CXCodeComplete_IncludeCodePatterns = 2;
1127        const CXCodeComplete_IncludeBriefComments = 4;
1128        const CXCodeComplete_SkipPreamble = 8;
1129        const CXCodeComplete_IncludeCompletionsWithFixIts = 16;
1130    }
1131}
1132
1133cenum! {
1134    enum CXCompletionContext {
1135        const CXCompletionContext_Unexposed = 0;
1136        const CXCompletionContext_AnyType = 1;
1137        const CXCompletionContext_AnyValue = 2;
1138        const CXCompletionContext_ObjCObjectValue = 4;
1139        const CXCompletionContext_ObjCSelectorValue = 8;
1140        const CXCompletionContext_CXXClassTypeValue = 16;
1141        const CXCompletionContext_DotMemberAccess = 32;
1142        const CXCompletionContext_ArrowMemberAccess = 64;
1143        const CXCompletionContext_ObjCPropertyAccess = 128;
1144        const CXCompletionContext_EnumTag = 256;
1145        const CXCompletionContext_UnionTag = 512;
1146        const CXCompletionContext_StructTag = 1024;
1147        const CXCompletionContext_ClassTag = 2048;
1148        const CXCompletionContext_Namespace = 4096;
1149        const CXCompletionContext_NestedNameSpecifier = 8192;
1150        const CXCompletionContext_ObjCInterface = 16384;
1151        const CXCompletionContext_ObjCProtocol = 32768;
1152        const CXCompletionContext_ObjCCategory = 65536;
1153        const CXCompletionContext_ObjCInstanceMessage = 131072;
1154        const CXCompletionContext_ObjCClassMessage = 262144;
1155        const CXCompletionContext_ObjCSelectorName = 524288;
1156        const CXCompletionContext_MacroName = 1048576;
1157        const CXCompletionContext_NaturalLanguage = 2097152;
1158        const CXCompletionContext_IncludedFile = 4194304;
1159        const CXCompletionContext_Unknown = 8388607;
1160    }
1161}
1162
1163cenum! {
1164    enum CXDiagnosticDisplayOptions {
1165        const CXDiagnostic_DisplaySourceLocation = 1;
1166        const CXDiagnostic_DisplayColumn = 2;
1167        const CXDiagnostic_DisplaySourceRanges = 4;
1168        const CXDiagnostic_DisplayOption = 8;
1169        const CXDiagnostic_DisplayCategoryId = 16;
1170        const CXDiagnostic_DisplayCategoryName = 32;
1171    }
1172}
1173
1174cenum! {
1175    enum CXGlobalOptFlags {
1176        const CXGlobalOpt_None = 0;
1177        const CXGlobalOpt_ThreadBackgroundPriorityForIndexing = 1;
1178        const CXGlobalOpt_ThreadBackgroundPriorityForEditing = 2;
1179        const CXGlobalOpt_ThreadBackgroundPriorityForAll = 3;
1180    }
1181}
1182
1183cenum! {
1184    enum CXIdxDeclInfoFlags {
1185        const CXIdxDeclFlag_Skipped = 1;
1186    }
1187}
1188
1189cenum! {
1190    enum CXIndexOptFlags {
1191        const CXIndexOptNone = 0;
1192        const CXIndexOptSuppressRedundantRefs = 1;
1193        const CXIndexOptIndexFunctionLocalSymbols = 2;
1194        const CXIndexOptIndexImplicitTemplateInstantiations = 4;
1195        const CXIndexOptSuppressWarnings = 8;
1196        const CXIndexOptSkipParsedBodiesInSession = 16;
1197    }
1198}
1199
1200cenum! {
1201    enum CXNameRefFlags {
1202        const CXNameRange_WantQualifier = 1;
1203        const CXNameRange_WantTemplateArgs = 2;
1204        const CXNameRange_WantSinglePiece = 4;
1205    }
1206}
1207
1208cenum! {
1209    enum CXObjCDeclQualifierKind {
1210        const CXObjCDeclQualifier_None = 0;
1211        const CXObjCDeclQualifier_In = 1;
1212        const CXObjCDeclQualifier_Inout = 2;
1213        const CXObjCDeclQualifier_Out = 4;
1214        const CXObjCDeclQualifier_Bycopy = 8;
1215        const CXObjCDeclQualifier_Byref = 16;
1216        const CXObjCDeclQualifier_Oneway = 32;
1217    }
1218}
1219
1220cenum! {
1221    enum CXObjCPropertyAttrKind {
1222        const CXObjCPropertyAttr_noattr = 0;
1223        const CXObjCPropertyAttr_readonly = 1;
1224        const CXObjCPropertyAttr_getter = 2;
1225        const CXObjCPropertyAttr_assign = 4;
1226        const CXObjCPropertyAttr_readwrite = 8;
1227        const CXObjCPropertyAttr_retain = 16;
1228        const CXObjCPropertyAttr_copy = 32;
1229        const CXObjCPropertyAttr_nonatomic = 64;
1230        const CXObjCPropertyAttr_setter = 128;
1231        const CXObjCPropertyAttr_atomic = 256;
1232        const CXObjCPropertyAttr_weak = 512;
1233        const CXObjCPropertyAttr_strong = 1024;
1234        const CXObjCPropertyAttr_unsafe_unretained = 2048;
1235        /// Only available on `libclang` 3.9 and later.
1236        #[cfg(feature = "clang_3_9")]
1237        const CXObjCPropertyAttr_class = 4096;
1238    }
1239}
1240
1241cenum! {
1242    enum CXReparse_Flags {
1243        const CXReparse_None = 0;
1244    }
1245}
1246
1247cenum! {
1248    enum CXSaveTranslationUnit_Flags {
1249        const CXSaveTranslationUnit_None = 0;
1250    }
1251}
1252
1253cenum! {
1254    /// Only available on `libclang` 7.0 and later.
1255    #[cfg(feature = "clang_7_0")]
1256    enum CXSymbolRole {
1257        const CXSymbolRole_None = 0;
1258        const CXSymbolRole_Declaration = 1;
1259        const CXSymbolRole_Definition = 2;
1260        const CXSymbolRole_Reference = 4;
1261        const CXSymbolRole_Read = 8;
1262        const CXSymbolRole_Write = 16;
1263        const CXSymbolRole_Call = 32;
1264        const CXSymbolRole_Dynamic = 64;
1265        const CXSymbolRole_AddressOf = 128;
1266        const CXSymbolRole_Implicit = 256;
1267    }
1268}
1269
1270cenum! {
1271    enum CXTranslationUnit_Flags {
1272        const CXTranslationUnit_None = 0;
1273        const CXTranslationUnit_DetailedPreprocessingRecord = 1;
1274        const CXTranslationUnit_Incomplete = 2;
1275        const CXTranslationUnit_PrecompiledPreamble = 4;
1276        const CXTranslationUnit_CacheCompletionResults = 8;
1277        const CXTranslationUnit_ForSerialization = 16;
1278        const CXTranslationUnit_CXXChainedPCH = 32;
1279        const CXTranslationUnit_SkipFunctionBodies = 64;
1280        const CXTranslationUnit_IncludeBriefCommentsInCodeCompletion = 128;
1281        /// Only available on `libclang` 3.8 and later.
1282        #[cfg(feature = "clang_3_8")]
1283        const CXTranslationUnit_CreatePreambleOnFirstParse = 256;
1284        /// Only available on `libclang` 3.9 and later.
1285        #[cfg(feature = "clang_3_9")]
1286        const CXTranslationUnit_KeepGoing = 512;
1287        /// Only available on `libclang` 5.0 and later.
1288        #[cfg(feature = "clang_5_0")]
1289        const CXTranslationUnit_SingleFileParse = 1024;
1290        /// Only available on `libclang` 7.0 and later.
1291        #[cfg(feature = "clang_7_0")]
1292        const CXTranslationUnit_LimitSkipFunctionBodiesToPreamble = 2048;
1293        /// Only available on `libclang` 8.0 and later.
1294        #[cfg(feature = "clang_8_0")]
1295        const CXTranslationUnit_IncludeAttributedTypes = 4096;
1296        /// Only available on `libclang` 8.0 and later.
1297        #[cfg(feature = "clang_8_0")]
1298        const CXTranslationUnit_VisitImplicitAttributes = 8192;
1299        /// Only available on `libclang` 9.0 and later.
1300        #[cfg(feature = "clang_9_0")]
1301        const CXTranslationUnit_IgnoreNonErrorsFromIncludedFiles = 16384;
1302        /// Only available on `libclang` 10.0 and later.
1303        #[cfg(feature = "clang_10_0")]
1304        const CXTranslationUnit_RetainExcludedConditionalBlocks = 32768;
1305    }
1306}
1307
1308//================================================
1309// Structs
1310//================================================
1311
1312// Opaque ________________________________________
1313
1314macro_rules! opaque {
1315    ($name:ident) => {
1316        pub type $name = *mut c_void;
1317    };
1318}
1319
1320opaque!(CXCompilationDatabase);
1321opaque!(CXCompileCommand);
1322opaque!(CXCompileCommands);
1323opaque!(CXCompletionString);
1324opaque!(CXCursorSet);
1325opaque!(CXDiagnostic);
1326opaque!(CXDiagnosticSet);
1327#[cfg(feature = "clang_3_9")]
1328opaque!(CXEvalResult);
1329opaque!(CXFile);
1330opaque!(CXIdxClientASTFile);
1331opaque!(CXIdxClientContainer);
1332opaque!(CXIdxClientEntity);
1333opaque!(CXIdxClientFile);
1334opaque!(CXIndex);
1335opaque!(CXIndexAction);
1336opaque!(CXModule);
1337#[cfg(feature = "clang_7_0")]
1338opaque!(CXPrintingPolicy);
1339opaque!(CXRemapping);
1340#[cfg(feature = "clang_5_0")]
1341opaque!(CXTargetInfo);
1342opaque!(CXTranslationUnit);
1343
1344// Transparent ___________________________________
1345
1346#[derive(Copy, Clone, Debug)]
1347#[repr(C)]
1348pub struct CXCodeCompleteResults {
1349    pub Results: *mut CXCompletionResult,
1350    pub NumResults: c_uint,
1351}
1352
1353default!(CXCodeCompleteResults);
1354
1355#[derive(Copy, Clone, Debug)]
1356#[repr(C)]
1357pub struct CXComment {
1358    pub ASTNode: *const c_void,
1359    pub TranslationUnit: CXTranslationUnit,
1360}
1361
1362default!(CXComment);
1363
1364#[derive(Copy, Clone, Debug)]
1365#[repr(C)]
1366pub struct CXCompletionResult {
1367    pub CursorKind: CXCursorKind,
1368    pub CompletionString: CXCompletionString,
1369}
1370
1371default!(CXCompletionResult);
1372
1373#[derive(Copy, Clone, Debug)]
1374#[repr(C)]
1375pub struct CXCursor {
1376    pub kind: CXCursorKind,
1377    pub xdata: c_int,
1378    pub data: [*const c_void; 3],
1379}
1380
1381default!(CXCursor);
1382
1383#[derive(Copy, Clone, Debug)]
1384#[repr(C)]
1385pub struct CXCursorAndRangeVisitor {
1386    pub context: *mut c_void,
1387    pub visit: Option<extern "C" fn(*mut c_void, CXCursor, CXSourceRange) -> CXVisitorResult>,
1388}
1389
1390default!(CXCursorAndRangeVisitor);
1391
1392#[derive(Copy, Clone, Debug)]
1393#[repr(C)]
1394pub struct CXFileUniqueID {
1395    pub data: [c_ulonglong; 3],
1396}
1397
1398default!(CXFileUniqueID);
1399
1400#[derive(Copy, Clone, Debug)]
1401#[repr(C)]
1402pub struct CXIdxAttrInfo {
1403    pub kind: CXIdxAttrKind,
1404    pub cursor: CXCursor,
1405    pub loc: CXIdxLoc,
1406}
1407
1408default!(CXIdxAttrInfo);
1409
1410#[derive(Copy, Clone, Debug)]
1411#[repr(C)]
1412pub struct CXIdxBaseClassInfo {
1413    pub base: *const CXIdxEntityInfo,
1414    pub cursor: CXCursor,
1415    pub loc: CXIdxLoc,
1416}
1417
1418default!(CXIdxBaseClassInfo);
1419
1420#[derive(Copy, Clone, Debug)]
1421#[repr(C)]
1422pub struct CXIdxCXXClassDeclInfo {
1423    pub declInfo: *const CXIdxDeclInfo,
1424    pub bases: *const *const CXIdxBaseClassInfo,
1425    pub numBases: c_uint,
1426}
1427
1428default!(CXIdxCXXClassDeclInfo);
1429
1430#[derive(Copy, Clone, Debug)]
1431#[repr(C)]
1432pub struct CXIdxContainerInfo {
1433    pub cursor: CXCursor,
1434}
1435
1436default!(CXIdxContainerInfo);
1437
1438#[derive(Copy, Clone, Debug)]
1439#[repr(C)]
1440pub struct CXIdxDeclInfo {
1441    pub entityInfo: *const CXIdxEntityInfo,
1442    pub cursor: CXCursor,
1443    pub loc: CXIdxLoc,
1444    pub semanticContainer: *const CXIdxContainerInfo,
1445    pub lexicalContainer: *const CXIdxContainerInfo,
1446    pub isRedeclaration: c_int,
1447    pub isDefinition: c_int,
1448    pub isContainer: c_int,
1449    pub declAsContainer: *const CXIdxContainerInfo,
1450    pub isImplicit: c_int,
1451    pub attributes: *const *const CXIdxAttrInfo,
1452    pub numAttributes: c_uint,
1453    pub flags: c_uint,
1454}
1455
1456default!(CXIdxDeclInfo);
1457
1458#[derive(Copy, Clone, Debug)]
1459#[repr(C)]
1460pub struct CXIdxEntityInfo {
1461    pub kind: CXIdxEntityKind,
1462    pub templateKind: CXIdxEntityCXXTemplateKind,
1463    pub lang: CXIdxEntityLanguage,
1464    pub name: *const c_char,
1465    pub USR: *const c_char,
1466    pub cursor: CXCursor,
1467    pub attributes: *const *const CXIdxAttrInfo,
1468    pub numAttributes: c_uint,
1469}
1470
1471default!(CXIdxEntityInfo);
1472
1473#[derive(Copy, Clone, Debug)]
1474#[repr(C)]
1475pub struct CXIdxEntityRefInfo {
1476    pub kind: CXIdxEntityRefKind,
1477    pub cursor: CXCursor,
1478    pub loc: CXIdxLoc,
1479    pub referencedEntity: *const CXIdxEntityInfo,
1480    pub parentEntity: *const CXIdxEntityInfo,
1481    pub container: *const CXIdxContainerInfo,
1482    /// Only available on `libclang` 7.0 and later.
1483    #[cfg(feature = "clang_7_0")]
1484    pub role: CXSymbolRole,
1485}
1486
1487default!(CXIdxEntityRefInfo);
1488
1489#[derive(Copy, Clone, Debug)]
1490#[repr(C)]
1491pub struct CXIdxIBOutletCollectionAttrInfo {
1492    pub attrInfo: *const CXIdxAttrInfo,
1493    pub objcClass: *const CXIdxEntityInfo,
1494    pub classCursor: CXCursor,
1495    pub classLoc: CXIdxLoc,
1496}
1497
1498default!(CXIdxIBOutletCollectionAttrInfo);
1499
1500#[derive(Copy, Clone, Debug)]
1501#[repr(C)]
1502pub struct CXIdxImportedASTFileInfo {
1503    pub file: CXFile,
1504    pub module: CXModule,
1505    pub loc: CXIdxLoc,
1506    pub isImplicit: c_int,
1507}
1508
1509default!(CXIdxImportedASTFileInfo);
1510
1511#[derive(Copy, Clone, Debug)]
1512#[repr(C)]
1513pub struct CXIdxIncludedFileInfo {
1514    pub hashLoc: CXIdxLoc,
1515    pub filename: *const c_char,
1516    pub file: CXFile,
1517    pub isImport: c_int,
1518    pub isAngled: c_int,
1519    pub isModuleImport: c_int,
1520}
1521
1522default!(CXIdxIncludedFileInfo);
1523
1524#[derive(Copy, Clone, Debug)]
1525#[repr(C)]
1526pub struct CXIdxLoc {
1527    pub ptr_data: [*mut c_void; 2],
1528    pub int_data: c_uint,
1529}
1530
1531default!(CXIdxLoc);
1532
1533#[derive(Copy, Clone, Debug)]
1534#[repr(C)]
1535pub struct CXIdxObjCCategoryDeclInfo {
1536    pub containerInfo: *const CXIdxObjCContainerDeclInfo,
1537    pub objcClass: *const CXIdxEntityInfo,
1538    pub classCursor: CXCursor,
1539    pub classLoc: CXIdxLoc,
1540    pub protocols: *const CXIdxObjCProtocolRefListInfo,
1541}
1542
1543default!(CXIdxObjCCategoryDeclInfo);
1544
1545#[derive(Copy, Clone, Debug)]
1546#[repr(C)]
1547pub struct CXIdxObjCContainerDeclInfo {
1548    pub declInfo: *const CXIdxDeclInfo,
1549    pub kind: CXIdxObjCContainerKind,
1550}
1551
1552default!(CXIdxObjCContainerDeclInfo);
1553
1554#[derive(Copy, Clone, Debug)]
1555#[repr(C)]
1556pub struct CXIdxObjCInterfaceDeclInfo {
1557    pub containerInfo: *const CXIdxObjCContainerDeclInfo,
1558    pub superInfo: *const CXIdxBaseClassInfo,
1559    pub protocols: *const CXIdxObjCProtocolRefListInfo,
1560}
1561
1562default!(CXIdxObjCInterfaceDeclInfo);
1563
1564#[derive(Copy, Clone, Debug)]
1565#[repr(C)]
1566pub struct CXIdxObjCPropertyDeclInfo {
1567    pub declInfo: *const CXIdxDeclInfo,
1568    pub getter: *const CXIdxEntityInfo,
1569    pub setter: *const CXIdxEntityInfo,
1570}
1571
1572default!(CXIdxObjCPropertyDeclInfo);
1573
1574#[derive(Copy, Clone, Debug)]
1575#[repr(C)]
1576pub struct CXIdxObjCProtocolRefInfo {
1577    pub protocol: *const CXIdxEntityInfo,
1578    pub cursor: CXCursor,
1579    pub loc: CXIdxLoc,
1580}
1581
1582default!(CXIdxObjCProtocolRefInfo);
1583
1584#[derive(Copy, Clone, Debug)]
1585#[repr(C)]
1586pub struct CXIdxObjCProtocolRefListInfo {
1587    pub protocols: *const *const CXIdxObjCProtocolRefInfo,
1588    pub numProtocols: c_uint,
1589}
1590
1591default!(CXIdxObjCProtocolRefListInfo);
1592
1593#[derive(Copy, Clone, Debug)]
1594#[repr(C)]
1595pub struct CXPlatformAvailability {
1596    pub Platform: CXString,
1597    pub Introduced: CXVersion,
1598    pub Deprecated: CXVersion,
1599    pub Obsoleted: CXVersion,
1600    pub Unavailable: c_int,
1601    pub Message: CXString,
1602}
1603
1604default!(CXPlatformAvailability);
1605
1606#[derive(Copy, Clone, Debug)]
1607#[repr(C)]
1608pub struct CXSourceLocation {
1609    pub ptr_data: [*const c_void; 2],
1610    pub int_data: c_uint,
1611}
1612
1613default!(CXSourceLocation);
1614
1615#[derive(Copy, Clone, Debug)]
1616#[repr(C)]
1617pub struct CXSourceRange {
1618    pub ptr_data: [*const c_void; 2],
1619    pub begin_int_data: c_uint,
1620    pub end_int_data: c_uint,
1621}
1622
1623default!(CXSourceRange);
1624
1625#[derive(Copy, Clone, Debug)]
1626#[repr(C)]
1627pub struct CXSourceRangeList {
1628    pub count: c_uint,
1629    pub ranges: *mut CXSourceRange,
1630}
1631
1632default!(CXSourceRangeList);
1633
1634#[derive(Copy, Clone, Debug)]
1635#[repr(C)]
1636pub struct CXString {
1637    pub data: *const c_void,
1638    pub private_flags: c_uint,
1639}
1640
1641default!(CXString);
1642
1643#[cfg(feature = "clang_3_8")]
1644#[derive(Copy, Clone, Debug)]
1645#[repr(C)]
1646pub struct CXStringSet {
1647    pub Strings: *mut CXString,
1648    pub Count: c_uint,
1649}
1650
1651#[cfg(feature = "clang_3_8")]
1652default!(CXStringSet);
1653
1654#[derive(Copy, Clone, Debug)]
1655#[repr(C)]
1656pub struct CXTUResourceUsage {
1657    pub data: *mut c_void,
1658    pub numEntries: c_uint,
1659    pub entries: *mut CXTUResourceUsageEntry,
1660}
1661
1662default!(CXTUResourceUsage);
1663
1664#[derive(Copy, Clone, Debug)]
1665#[repr(C)]
1666pub struct CXTUResourceUsageEntry {
1667    pub kind: CXTUResourceUsageKind,
1668    pub amount: c_ulong,
1669}
1670
1671default!(CXTUResourceUsageEntry);
1672
1673#[derive(Copy, Clone, Debug)]
1674#[repr(C)]
1675pub struct CXToken {
1676    pub int_data: [c_uint; 4],
1677    pub ptr_data: *mut c_void,
1678}
1679
1680default!(CXToken);
1681
1682#[derive(Copy, Clone, Debug)]
1683#[repr(C)]
1684pub struct CXType {
1685    pub kind: CXTypeKind,
1686    pub data: [*mut c_void; 2],
1687}
1688
1689default!(CXType);
1690
1691#[derive(Copy, Clone, Debug)]
1692#[repr(C)]
1693pub struct CXUnsavedFile {
1694    pub Filename: *const c_char,
1695    pub Contents: *const c_char,
1696    pub Length: c_ulong,
1697}
1698
1699default!(CXUnsavedFile);
1700
1701#[derive(Copy, Clone, Debug)]
1702#[repr(C)]
1703pub struct CXVersion {
1704    pub Major: c_int,
1705    pub Minor: c_int,
1706    pub Subminor: c_int,
1707}
1708
1709default!(CXVersion);
1710
1711#[derive(Copy, Clone, Debug)]
1712#[repr(C)]
1713#[rustfmt::skip]
1714pub struct IndexerCallbacks {
1715    pub abortQuery: Option<extern "C" fn(CXClientData, *mut c_void) -> c_int>,
1716    pub diagnostic: Option<extern "C" fn(CXClientData, CXDiagnosticSet, *mut c_void)>,
1717    pub enteredMainFile: Option<extern "C" fn(CXClientData, CXFile, *mut c_void) -> CXIdxClientFile>,
1718    pub ppIncludedFile: Option<extern "C" fn(CXClientData, *const CXIdxIncludedFileInfo) -> CXIdxClientFile>,
1719    pub importedASTFile: Option<extern "C" fn(CXClientData, *const CXIdxImportedASTFileInfo) -> CXIdxClientASTFile>,
1720    pub startedTranslationUnit: Option<extern "C" fn(CXClientData, *mut c_void) -> CXIdxClientContainer>,
1721    pub indexDeclaration: Option<extern "C" fn(CXClientData, *const CXIdxDeclInfo)>,
1722    pub indexEntityReference: Option<extern "C" fn(CXClientData, *const CXIdxEntityRefInfo)>,
1723}
1724
1725default!(IndexerCallbacks);
1726
1727//================================================
1728// Functions
1729//================================================
1730
1731link! {
1732    pub fn clang_CXCursorSet_contains(set: CXCursorSet, cursor: CXCursor) -> c_uint;
1733    pub fn clang_CXCursorSet_insert(set: CXCursorSet, cursor: CXCursor) -> c_uint;
1734    pub fn clang_CXIndex_getGlobalOptions(index: CXIndex) -> CXGlobalOptFlags;
1735    pub fn clang_CXIndex_setGlobalOptions(index: CXIndex, flags: CXGlobalOptFlags);
1736    /// Only available on `libclang` 6.0 and later.
1737    #[cfg(feature = "clang_6_0")]
1738    pub fn clang_CXIndex_setInvocationEmissionPathOption(index: CXIndex, path: *const c_char);
1739    /// Only available on `libclang` 3.9 and later.
1740    #[cfg(feature = "clang_3_9")]
1741    pub fn clang_CXXConstructor_isConvertingConstructor(cursor: CXCursor) -> c_uint;
1742    /// Only available on `libclang` 3.9 and later.
1743    #[cfg(feature = "clang_3_9")]
1744    pub fn clang_CXXConstructor_isCopyConstructor(cursor: CXCursor) -> c_uint;
1745    /// Only available on `libclang` 3.9 and later.
1746    #[cfg(feature = "clang_3_9")]
1747    pub fn clang_CXXConstructor_isDefaultConstructor(cursor: CXCursor) -> c_uint;
1748    /// Only available on `libclang` 3.9 and later.
1749    #[cfg(feature = "clang_3_9")]
1750    pub fn clang_CXXConstructor_isMoveConstructor(cursor: CXCursor) -> c_uint;
1751    /// Only available on `libclang` 3.8 and later.
1752    #[cfg(feature = "clang_3_8")]
1753    pub fn clang_CXXField_isMutable(cursor: CXCursor) -> c_uint;
1754    pub fn clang_CXXMethod_isConst(cursor: CXCursor) -> c_uint;
1755    /// Only available on `libclang` 3.9 and later.
1756    #[cfg(feature = "clang_3_9")]
1757    pub fn clang_CXXMethod_isDefaulted(cursor: CXCursor) -> c_uint;
1758    pub fn clang_CXXMethod_isPureVirtual(cursor: CXCursor) -> c_uint;
1759    pub fn clang_CXXMethod_isStatic(cursor: CXCursor) -> c_uint;
1760    pub fn clang_CXXMethod_isVirtual(cursor: CXCursor) -> c_uint;
1761    /// Only available on `libclang` 6.0 and later.
1762    #[cfg(feature = "clang_6_0")]
1763    pub fn clang_CXXRecord_isAbstract(cursor: CXCursor) -> c_uint;
1764    pub fn clang_CompilationDatabase_dispose(database: CXCompilationDatabase);
1765    pub fn clang_CompilationDatabase_fromDirectory(directory: *const c_char, error: *mut CXCompilationDatabase_Error) -> CXCompilationDatabase;
1766    pub fn clang_CompilationDatabase_getAllCompileCommands(database: CXCompilationDatabase) -> CXCompileCommands;
1767    pub fn clang_CompilationDatabase_getCompileCommands(database: CXCompilationDatabase, filename: *const c_char) -> CXCompileCommands;
1768    pub fn clang_CompileCommand_getArg(command: CXCompileCommand, index: c_uint) -> CXString;
1769    pub fn clang_CompileCommand_getDirectory(command: CXCompileCommand) -> CXString;
1770    /// Only available on `libclang` 3.8 and later.
1771    #[cfg(feature = "clang_3_8")]
1772    pub fn clang_CompileCommand_getFilename(command: CXCompileCommand) -> CXString;
1773    /// Only available on `libclang` 3.8 and later.
1774    #[cfg(feature = "clang_3_8")]
1775    pub fn clang_CompileCommand_getMappedSourceContent(command: CXCompileCommand, index: c_uint) -> CXString;
1776    /// Only available on `libclang` 3.8 and later.
1777    #[cfg(feature = "clang_3_8")]
1778    pub fn clang_CompileCommand_getMappedSourcePath(command: CXCompileCommand, index: c_uint) -> CXString;
1779    pub fn clang_CompileCommand_getNumArgs(command: CXCompileCommand) -> c_uint;
1780    pub fn clang_CompileCommand_getNumMappedSources(command: CXCompileCommand) -> c_uint;
1781    pub fn clang_CompileCommands_dispose(command: CXCompileCommands);
1782    pub fn clang_CompileCommands_getCommand(command: CXCompileCommands, index: c_uint) -> CXCompileCommand;
1783    pub fn clang_CompileCommands_getSize(command: CXCompileCommands) -> c_uint;
1784    /// Only available on `libclang` 3.9 and later.
1785    #[cfg(feature = "clang_3_9")]
1786    pub fn clang_Cursor_Evaluate(cursor: CXCursor) -> CXEvalResult;
1787    pub fn clang_Cursor_getArgument(cursor: CXCursor, index: c_uint) -> CXCursor;
1788    pub fn clang_Cursor_getBriefCommentText(cursor: CXCursor) -> CXString;
1789    /// Only available on `libclang` 3.8 and later.
1790    #[cfg(feature = "clang_3_8")]
1791    pub fn clang_Cursor_getCXXManglings(cursor: CXCursor) -> *mut CXStringSet;
1792    pub fn clang_Cursor_getCommentRange(cursor: CXCursor) -> CXSourceRange;
1793    /// Only available on `libclang` 3.6 and later.
1794    #[cfg(feature = "clang_3_6")]
1795    pub fn clang_Cursor_getMangling(cursor: CXCursor) -> CXString;
1796    pub fn clang_Cursor_getModule(cursor: CXCursor) -> CXModule;
1797    pub fn clang_Cursor_getNumArguments(cursor: CXCursor) -> c_int;
1798    /// Only available on `libclang` 3.6 and later.
1799    #[cfg(feature = "clang_3_6")]
1800    pub fn clang_Cursor_getNumTemplateArguments(cursor: CXCursor) -> c_int;
1801    pub fn clang_Cursor_getObjCDeclQualifiers(cursor: CXCursor) -> CXObjCDeclQualifierKind;
1802    /// Only available on `libclang` 6.0 and later.
1803    #[cfg(feature = "clang_6_0")]
1804    pub fn clang_Cursor_getObjCManglings(cursor: CXCursor) -> *mut CXStringSet;
1805    pub fn clang_Cursor_getObjCPropertyAttributes(cursor: CXCursor, reserved: c_uint) -> CXObjCPropertyAttrKind;
1806    /// Only available on `libclang` 8.0 and later.
1807    #[cfg(feature = "clang_8_0")]
1808    pub fn clang_Cursor_getObjCPropertyGetterName(cursor: CXCursor) -> CXString;
1809    /// Only available on `libclang` 8.0 and later.
1810    #[cfg(feature = "clang_8_0")]
1811    pub fn clang_Cursor_getObjCPropertySetterName(cursor: CXCursor) -> CXString;
1812    pub fn clang_Cursor_getObjCSelectorIndex(cursor: CXCursor) -> c_int;
1813    /// Only available on `libclang` 3.7 and later.
1814    #[cfg(feature = "clang_3_7")]
1815    pub fn clang_Cursor_getOffsetOfField(cursor: CXCursor) -> c_longlong;
1816    pub fn clang_Cursor_getRawCommentText(cursor: CXCursor) -> CXString;
1817    pub fn clang_Cursor_getReceiverType(cursor: CXCursor) -> CXType;
1818    pub fn clang_Cursor_getSpellingNameRange(cursor: CXCursor, index: c_uint, reserved: c_uint) -> CXSourceRange;
1819    /// Only available on `libclang` 3.6 and later.
1820    #[cfg(feature = "clang_3_6")]
1821    pub fn clang_Cursor_getStorageClass(cursor: CXCursor) -> CX_StorageClass;
1822    /// Only available on `libclang` 3.6 and later.
1823    #[cfg(feature = "clang_3_6")]
1824    pub fn clang_Cursor_getTemplateArgumentKind(cursor: CXCursor, index: c_uint) -> CXTemplateArgumentKind;
1825    /// Only available on `libclang` 3.6 and later.
1826    #[cfg(feature = "clang_3_6")]
1827    pub fn clang_Cursor_getTemplateArgumentType(cursor: CXCursor, index: c_uint) -> CXType;
1828    /// Only available on `libclang` 3.6 and later.
1829    #[cfg(feature = "clang_3_6")]
1830    pub fn clang_Cursor_getTemplateArgumentUnsignedValue(cursor: CXCursor, index: c_uint) -> c_ulonglong;
1831    /// Only available on `libclang` 3.6 and later.
1832    #[cfg(feature = "clang_3_6")]
1833    pub fn clang_Cursor_getTemplateArgumentValue(cursor: CXCursor, index: c_uint) -> c_longlong;
1834    pub fn clang_Cursor_getTranslationUnit(cursor: CXCursor) -> CXTranslationUnit;
1835    /// Only available on `libclang` 12.0 and later.
1836    #[cfg(feature = "clang_12_0")]
1837    pub fn clang_Cursor_getVarDeclInitializer(cursor: CXCursor) -> CXCursor;
1838    /// Only available on `libclang` 3.9 and later.
1839    #[cfg(feature = "clang_3_9")]
1840    pub fn clang_Cursor_hasAttrs(cursor: CXCursor) -> c_uint;
1841    /// Only available on `libclang` 12.0 and later.
1842    #[cfg(feature = "clang_12_0")]
1843    pub fn clang_Cursor_hasVarDeclGlobalStorage(cursor: CXCursor) -> c_uint;
1844    /// Only available on `libclang` 12.0 and later.
1845    #[cfg(feature = "clang_12_0")]
1846    pub fn clang_Cursor_hasVarDeclExternalStorage(cursor: CXCursor) -> c_uint;
1847    /// Only available on `libclang` 3.7 and later.
1848    #[cfg(feature = "clang_3_7")]
1849    pub fn clang_Cursor_isAnonymous(cursor: CXCursor) -> c_uint;
1850    /// Only available on `libclang` 9.0 and later.
1851    #[cfg(feature = "clang_9_0")]
1852    pub fn clang_Cursor_isAnonymousRecordDecl(cursor: CXCursor) -> c_uint;
1853    pub fn clang_Cursor_isBitField(cursor: CXCursor) -> c_uint;
1854    pub fn clang_Cursor_isDynamicCall(cursor: CXCursor) -> c_int;
1855    /// Only available on `libclang` 5.0 and later.
1856    #[cfg(feature = "clang_5_0")]
1857    pub fn clang_Cursor_isExternalSymbol(cursor: CXCursor, language: *mut CXString, from: *mut CXString, generated: *mut c_uint) -> c_uint;
1858    /// Only available on `libclang` 3.9 and later.
1859    #[cfg(feature = "clang_3_9")]
1860    pub fn clang_Cursor_isFunctionInlined(cursor: CXCursor) -> c_uint;
1861    /// Only available on `libclang` 9.0 and later.
1862    #[cfg(feature = "clang_9_0")]
1863    pub fn clang_Cursor_isInlineNamespace(cursor: CXCursor) -> c_uint;
1864    /// Only available on `libclang` 3.9 and later.
1865    #[cfg(feature = "clang_3_9")]
1866    pub fn clang_Cursor_isMacroBuiltin(cursor: CXCursor) -> c_uint;
1867    /// Only available on `libclang` 3.9 and later.
1868    #[cfg(feature = "clang_3_9")]
1869    pub fn clang_Cursor_isMacroFunctionLike(cursor: CXCursor) -> c_uint;
1870    pub fn clang_Cursor_isNull(cursor: CXCursor) -> c_int;
1871    pub fn clang_Cursor_isObjCOptional(cursor: CXCursor) -> c_uint;
1872    pub fn clang_Cursor_isVariadic(cursor: CXCursor) -> c_uint;
1873    /// Only available on `libclang` 5.0 and later.
1874    #[cfg(feature = "clang_5_0")]
1875    pub fn clang_EnumDecl_isScoped(cursor: CXCursor) -> c_uint;
1876    /// Only available on `libclang` 3.9 and later.
1877    #[cfg(feature = "clang_3_9")]
1878    pub fn clang_EvalResult_dispose(result: CXEvalResult);
1879    /// Only available on `libclang` 3.9 and later.
1880    #[cfg(feature = "clang_3_9")]
1881    pub fn clang_EvalResult_getAsDouble(result: CXEvalResult) -> libc::c_double;
1882    /// Only available on `libclang` 3.9 and later.
1883    #[cfg(feature = "clang_3_9")]
1884    pub fn clang_EvalResult_getAsInt(result: CXEvalResult) -> c_int;
1885    /// Only available on `libclang` 4.0 and later.
1886    #[cfg(feature = "clang_4_0")]
1887    pub fn clang_EvalResult_getAsLongLong(result: CXEvalResult) -> c_longlong;
1888    /// Only available on `libclang` 3.9 and later.
1889    #[cfg(feature = "clang_3_9")]
1890    pub fn clang_EvalResult_getAsStr(result: CXEvalResult) -> *const c_char;
1891    /// Only available on `libclang` 4.0 and later.
1892    #[cfg(feature = "clang_4_0")]
1893    pub fn clang_EvalResult_getAsUnsigned(result: CXEvalResult) -> c_ulonglong;
1894    /// Only available on `libclang` 3.9 and later.
1895    #[cfg(feature = "clang_3_9")]
1896    pub fn clang_EvalResult_getKind(result: CXEvalResult) -> CXEvalResultKind;
1897    /// Only available on `libclang` 4.0 and later.
1898    #[cfg(feature = "clang_4_0")]
1899    pub fn clang_EvalResult_isUnsignedInt(result: CXEvalResult) -> c_uint;
1900    /// Only available on `libclang` 3.6 and later.
1901    #[cfg(feature = "clang_3_6")]
1902    pub fn clang_File_isEqual(left: CXFile, right: CXFile) -> c_int;
1903    /// Only available on `libclang` 7.0 and later.
1904    #[cfg(feature = "clang_7_0")]
1905    pub fn clang_File_tryGetRealPathName(file: CXFile) -> CXString;
1906    pub fn clang_IndexAction_create(index: CXIndex) -> CXIndexAction;
1907    pub fn clang_IndexAction_dispose(index: CXIndexAction);
1908    pub fn clang_Location_isFromMainFile(location: CXSourceLocation) -> c_int;
1909    pub fn clang_Location_isInSystemHeader(location: CXSourceLocation) -> c_int;
1910    pub fn clang_Module_getASTFile(module: CXModule) -> CXFile;
1911    pub fn clang_Module_getFullName(module: CXModule) -> CXString;
1912    pub fn clang_Module_getName(module: CXModule) -> CXString;
1913    pub fn clang_Module_getNumTopLevelHeaders(tu: CXTranslationUnit, module: CXModule) -> c_uint;
1914    pub fn clang_Module_getParent(module: CXModule) -> CXModule;
1915    pub fn clang_Module_getTopLevelHeader(tu: CXTranslationUnit, module: CXModule, index: c_uint) -> CXFile;
1916    pub fn clang_Module_isSystem(module: CXModule) -> c_int;
1917    /// Only available on `libclang` 7.0 and later.
1918    #[cfg(feature = "clang_7_0")]
1919    pub fn clang_PrintingPolicy_dispose(policy: CXPrintingPolicy);
1920    /// Only available on `libclang` 7.0 and later.
1921    #[cfg(feature = "clang_7_0")]
1922    pub fn clang_PrintingPolicy_getProperty(policy: CXPrintingPolicy, property: CXPrintingPolicyProperty) -> c_uint;
1923    /// Only available on `libclang` 7.0 and later.
1924    #[cfg(feature = "clang_7_0")]
1925    pub fn clang_PrintingPolicy_setProperty(policy: CXPrintingPolicy, property: CXPrintingPolicyProperty, value: c_uint);
1926    pub fn clang_Range_isNull(range: CXSourceRange) -> c_int;
1927    /// Only available on `libclang` 5.0 and later.
1928    #[cfg(feature = "clang_5_0")]
1929    pub fn clang_TargetInfo_dispose(info: CXTargetInfo);
1930    /// Only available on `libclang` 5.0 and later.
1931    #[cfg(feature = "clang_5_0")]
1932    pub fn clang_TargetInfo_getPointerWidth(info: CXTargetInfo) -> c_int;
1933    /// Only available on `libclang` 5.0 and later.
1934    #[cfg(feature = "clang_5_0")]
1935    pub fn clang_TargetInfo_getTriple(info: CXTargetInfo) -> CXString;
1936    pub fn clang_Type_getAlignOf(type_: CXType) -> c_longlong;
1937    pub fn clang_Type_getCXXRefQualifier(type_: CXType) -> CXRefQualifierKind;
1938    pub fn clang_Type_getClassType(type_: CXType) -> CXType;
1939    /// Only available on `libclang` 8.0 and later.
1940    #[cfg(feature = "clang_8_0")]
1941    pub fn clang_Type_getModifiedType(type_: CXType) -> CXType;
1942    /// Only available on `libclang` 3.9 and later.
1943    #[cfg(feature = "clang_3_9")]
1944    pub fn clang_Type_getNamedType(type_: CXType) -> CXType;
1945    /// Only available on `libclang` 8.0 and later.
1946    #[cfg(feature = "clang_8_0")]
1947    pub fn clang_Type_getNullability(type_: CXType) -> CXTypeNullabilityKind;
1948    /// Only available on `libclang` 8.0 and later.
1949    #[cfg(feature = "clang_8_0")]
1950    pub fn clang_Type_getNumObjCProtocolRefs(type_: CXType) -> c_uint;
1951    /// Only available on `libclang` 8.0 and later.
1952    #[cfg(feature = "clang_8_0")]
1953    pub fn clang_Type_getNumObjCTypeArgs(type_: CXType) -> c_uint;
1954    pub fn clang_Type_getNumTemplateArguments(type_: CXType) -> c_int;
1955    /// Only available on `libclang` 3.9 and later.
1956    #[cfg(feature = "clang_3_9")]
1957    pub fn clang_Type_getObjCEncoding(type_: CXType) -> CXString;
1958    /// Only available on `libclang` 8.0 and later.
1959    #[cfg(feature = "clang_8_0")]
1960    pub fn clang_Type_getObjCObjectBaseType(type_: CXType) -> CXType;
1961    /// Only available on `libclang` 8.0 and later.
1962    #[cfg(feature = "clang_8_0")]
1963    pub fn clang_Type_getObjCProtocolDecl(type_: CXType, index: c_uint) -> CXCursor;
1964    /// Only available on `libclang` 8.0 and later.
1965    #[cfg(feature = "clang_8_0")]
1966    pub fn clang_Type_getObjCTypeArg(type_: CXType, index: c_uint) -> CXType;
1967    pub fn clang_Type_getOffsetOf(type_: CXType, field: *const c_char) -> c_longlong;
1968    pub fn clang_Type_getSizeOf(type_: CXType) -> c_longlong;
1969    pub fn clang_Type_getTemplateArgumentAsType(type_: CXType, index: c_uint) -> CXType;
1970    /// Only available on `libclang` 11.0 and later.
1971    #[cfg(feature = "clang_11_0")]
1972    pub fn clang_Type_getValueType(type_: CXType) -> CXType;
1973    /// Only available on `libclang` 5.0 and later.
1974    #[cfg(feature = "clang_5_0")]
1975    pub fn clang_Type_isTransparentTagTypedef(type_: CXType) -> c_uint;
1976    /// Only available on `libclang` 3.7 and later.
1977    #[cfg(feature = "clang_3_7")]
1978    pub fn clang_Type_visitFields(type_: CXType, visitor: CXFieldVisitor, data: CXClientData) -> CXVisitorResult;
1979    pub fn clang_annotateTokens(tu: CXTranslationUnit, tokens: *mut CXToken, n_tokens: c_uint, cursors: *mut CXCursor);
1980    pub fn clang_codeCompleteAt(tu: CXTranslationUnit, file: *const c_char, line: c_uint, column: c_uint, unsaved: *mut CXUnsavedFile, n_unsaved: c_uint, flags: CXCodeComplete_Flags) -> *mut CXCodeCompleteResults;
1981    pub fn clang_codeCompleteGetContainerKind(results: *mut CXCodeCompleteResults, incomplete: *mut c_uint) -> CXCursorKind;
1982    pub fn clang_codeCompleteGetContainerUSR(results: *mut CXCodeCompleteResults) -> CXString;
1983    pub fn clang_codeCompleteGetContexts(results: *mut CXCodeCompleteResults) -> c_ulonglong;
1984    pub fn clang_codeCompleteGetDiagnostic(results: *mut CXCodeCompleteResults, index: c_uint) -> CXDiagnostic;
1985    pub fn clang_codeCompleteGetNumDiagnostics(results: *mut CXCodeCompleteResults) -> c_uint;
1986    pub fn clang_codeCompleteGetObjCSelector(results: *mut CXCodeCompleteResults) -> CXString;
1987    pub fn clang_constructUSR_ObjCCategory(class: *const c_char, category: *const c_char) -> CXString;
1988    pub fn clang_constructUSR_ObjCClass(class: *const c_char) -> CXString;
1989    pub fn clang_constructUSR_ObjCIvar(name: *const c_char, usr: CXString) -> CXString;
1990    pub fn clang_constructUSR_ObjCMethod(name: *const c_char, instance: c_uint, usr: CXString) -> CXString;
1991    pub fn clang_constructUSR_ObjCProperty(property: *const c_char, usr: CXString) -> CXString;
1992    pub fn clang_constructUSR_ObjCProtocol(protocol: *const c_char) -> CXString;
1993    pub fn clang_createCXCursorSet() -> CXCursorSet;
1994    pub fn clang_createIndex(exclude: c_int, display: c_int) -> CXIndex;
1995    pub fn clang_createTranslationUnit(index: CXIndex, file: *const c_char) -> CXTranslationUnit;
1996    pub fn clang_createTranslationUnit2(index: CXIndex, file: *const c_char, tu: *mut CXTranslationUnit) -> CXErrorCode;
1997    pub fn clang_createTranslationUnitFromSourceFile(index: CXIndex, file: *const c_char, n_arguments: c_int, arguments: *const *const c_char, n_unsaved: c_uint, unsaved: *mut CXUnsavedFile) -> CXTranslationUnit;
1998    pub fn clang_defaultCodeCompleteOptions() -> CXCodeComplete_Flags;
1999    pub fn clang_defaultDiagnosticDisplayOptions() -> CXDiagnosticDisplayOptions;
2000    pub fn clang_defaultEditingTranslationUnitOptions() -> CXTranslationUnit_Flags;
2001    pub fn clang_defaultReparseOptions(tu: CXTranslationUnit) -> CXReparse_Flags;
2002    pub fn clang_defaultSaveOptions(tu: CXTranslationUnit) -> CXSaveTranslationUnit_Flags;
2003    pub fn clang_disposeCXCursorSet(set: CXCursorSet);
2004    pub fn clang_disposeCXPlatformAvailability(availability: *mut CXPlatformAvailability);
2005    pub fn clang_disposeCXTUResourceUsage(usage: CXTUResourceUsage);
2006    pub fn clang_disposeCodeCompleteResults(results: *mut CXCodeCompleteResults);
2007    pub fn clang_disposeDiagnostic(diagnostic: CXDiagnostic);
2008    pub fn clang_disposeDiagnosticSet(diagnostic: CXDiagnosticSet);
2009    pub fn clang_disposeIndex(index: CXIndex);
2010    pub fn clang_disposeOverriddenCursors(cursors: *mut CXCursor);
2011    pub fn clang_disposeSourceRangeList(list: *mut CXSourceRangeList);
2012    pub fn clang_disposeString(string: CXString);
2013    /// Only available on `libclang` 3.8 and later.
2014    #[cfg(feature = "clang_3_8")]
2015    pub fn clang_disposeStringSet(set: *mut CXStringSet);
2016    pub fn clang_disposeTokens(tu: CXTranslationUnit, tokens: *mut CXToken, n_tokens: c_uint);
2017    pub fn clang_disposeTranslationUnit(tu: CXTranslationUnit);
2018    pub fn clang_enableStackTraces();
2019    pub fn clang_equalCursors(left: CXCursor, right: CXCursor) -> c_uint;
2020    pub fn clang_equalLocations(left: CXSourceLocation, right: CXSourceLocation) -> c_uint;
2021    pub fn clang_equalRanges(left: CXSourceRange, right: CXSourceRange) -> c_uint;
2022    pub fn clang_equalTypes(left: CXType, right: CXType) -> c_uint;
2023    pub fn clang_executeOnThread(function: extern fn(*mut c_void), data: *mut c_void, stack: c_uint);
2024    pub fn clang_findIncludesInFile(tu: CXTranslationUnit, file: CXFile, cursor: CXCursorAndRangeVisitor) -> CXResult;
2025    pub fn clang_findReferencesInFile(cursor: CXCursor, file: CXFile, visitor: CXCursorAndRangeVisitor) -> CXResult;
2026    pub fn clang_formatDiagnostic(diagnostic: CXDiagnostic, flags: CXDiagnosticDisplayOptions) -> CXString;
2027    /// Only available on `libclang` 3.7 and later.
2028    #[cfg(feature = "clang_3_7")]
2029    pub fn clang_free(buffer: *mut c_void);
2030    /// Only available on `libclang` 5.0 and later.
2031    #[cfg(feature = "clang_5_0")]
2032    pub fn clang_getAddressSpace(type_: CXType) -> c_uint;
2033    /// Only available on `libclang` 4.0 and later.
2034    #[cfg(feature = "clang_4_0")]
2035    pub fn clang_getAllSkippedRanges(tu: CXTranslationUnit) -> *mut CXSourceRangeList;
2036    pub fn clang_getArgType(type_: CXType, index: c_uint) -> CXType;
2037    pub fn clang_getArrayElementType(type_: CXType) -> CXType;
2038    pub fn clang_getArraySize(type_: CXType) -> c_longlong;
2039    pub fn clang_getCString(string: CXString) -> *const c_char;
2040    pub fn clang_getCXTUResourceUsage(tu: CXTranslationUnit) -> CXTUResourceUsage;
2041    pub fn clang_getCXXAccessSpecifier(cursor: CXCursor) -> CX_CXXAccessSpecifier;
2042    pub fn clang_getCanonicalCursor(cursor: CXCursor) -> CXCursor;
2043    pub fn clang_getCanonicalType(type_: CXType) -> CXType;
2044    pub fn clang_getChildDiagnostics(diagnostic: CXDiagnostic) -> CXDiagnosticSet;
2045    pub fn clang_getClangVersion() -> CXString;
2046    pub fn clang_getCompletionAnnotation(string: CXCompletionString, index: c_uint) -> CXString;
2047    pub fn clang_getCompletionAvailability(string: CXCompletionString) -> CXAvailabilityKind;
2048    pub fn clang_getCompletionBriefComment(string: CXCompletionString) -> CXString;
2049    pub fn clang_getCompletionChunkCompletionString(string: CXCompletionString, index: c_uint) -> CXCompletionString;
2050    pub fn clang_getCompletionChunkKind(string: CXCompletionString, index: c_uint) -> CXCompletionChunkKind;
2051    pub fn clang_getCompletionChunkText(string: CXCompletionString, index: c_uint) -> CXString;
2052    /// Only available on `libclang` 7.0 and later.
2053    #[cfg(feature = "clang_7_0")]
2054    pub fn clang_getCompletionFixIt(results: *mut CXCodeCompleteResults, completion_index: c_uint, fixit_index: c_uint, range: *mut CXSourceRange) -> CXString;
2055    pub fn clang_getCompletionNumAnnotations(string: CXCompletionString) -> c_uint;
2056    /// Only available on `libclang` 7.0 and later.
2057    #[cfg(feature = "clang_7_0")]
2058    pub fn clang_getCompletionNumFixIts(results: *mut CXCodeCompleteResults, completion_index: c_uint) -> c_uint;
2059    pub fn clang_getCompletionParent(string: CXCompletionString, kind: *mut CXCursorKind) -> CXString;
2060    pub fn clang_getCompletionPriority(string: CXCompletionString) -> c_uint;
2061    pub fn clang_getCursor(tu: CXTranslationUnit, location: CXSourceLocation) -> CXCursor;
2062    pub fn clang_getCursorAvailability(cursor: CXCursor) -> CXAvailabilityKind;
2063    pub fn clang_getCursorCompletionString(cursor: CXCursor) -> CXCompletionString;
2064    pub fn clang_getCursorDefinition(cursor: CXCursor) -> CXCursor;
2065    pub fn clang_getCursorDisplayName(cursor: CXCursor) -> CXString;
2066    /// Only available on `libclang` 5.0 and later.
2067    #[cfg(feature = "clang_5_0")]
2068    pub fn clang_getCursorExceptionSpecificationType(cursor: CXCursor) -> CXCursor_ExceptionSpecificationKind;
2069    pub fn clang_getCursorExtent(cursor: CXCursor) -> CXSourceRange;
2070    pub fn clang_getCursorKind(cursor: CXCursor) -> CXCursorKind;
2071    pub fn clang_getCursorKindSpelling(kind: CXCursorKind) -> CXString;
2072    pub fn clang_getCursorLanguage(cursor: CXCursor) -> CXLanguageKind;
2073    pub fn clang_getCursorLexicalParent(cursor: CXCursor) -> CXCursor;
2074    pub fn clang_getCursorLinkage(cursor: CXCursor) -> CXLinkageKind;
2075    pub fn clang_getCursorLocation(cursor: CXCursor) -> CXSourceLocation;
2076    pub fn clang_getCursorPlatformAvailability(cursor: CXCursor, deprecated: *mut c_int, deprecated_message: *mut CXString, unavailable: *mut c_int, unavailable_message: *mut CXString, availability: *mut CXPlatformAvailability, n_availability: c_int) -> c_int;
2077    /// Only available on `libclang` 7.0 and later.
2078    #[cfg(feature = "clang_7_0")]
2079    pub fn clang_getCursorPrettyPrinted(cursor: CXCursor, policy: CXPrintingPolicy) -> CXString;
2080    /// Only available on `libclang` 7.0 and later.
2081    #[cfg(feature = "clang_7_0")]
2082    pub fn clang_getCursorPrintingPolicy(cursor: CXCursor) -> CXPrintingPolicy;
2083    pub fn clang_getCursorReferenceNameRange(cursor: CXCursor, flags: CXNameRefFlags, index: c_uint) -> CXSourceRange;
2084    pub fn clang_getCursorReferenced(cursor: CXCursor) -> CXCursor;
2085    pub fn clang_getCursorResultType(cursor: CXCursor) -> CXType;
2086    pub fn clang_getCursorSemanticParent(cursor: CXCursor) -> CXCursor;
2087    pub fn clang_getCursorSpelling(cursor: CXCursor) -> CXString;
2088    /// Only available on `libclang` 6.0 and later.
2089    #[cfg(feature = "clang_6_0")]
2090    pub fn clang_getCursorTLSKind(cursor: CXCursor) -> CXTLSKind;
2091    pub fn clang_getCursorType(cursor: CXCursor) -> CXType;
2092    pub fn clang_getCursorUSR(cursor: CXCursor) -> CXString;
2093    /// Only available on `libclang` 3.8 and later.
2094    #[cfg(feature = "clang_3_8")]
2095    pub fn clang_getCursorVisibility(cursor: CXCursor) -> CXVisibilityKind;
2096    pub fn clang_getDeclObjCTypeEncoding(cursor: CXCursor) -> CXString;
2097    pub fn clang_getDefinitionSpellingAndExtent(cursor: CXCursor, start: *mut *const c_char, end: *mut *const c_char, start_line: *mut c_uint, start_column: *mut c_uint, end_line: *mut c_uint, end_column: *mut c_uint);
2098    pub fn clang_getDiagnostic(tu: CXTranslationUnit, index: c_uint) -> CXDiagnostic;
2099    pub fn clang_getDiagnosticCategory(diagnostic: CXDiagnostic) -> c_uint;
2100    pub fn clang_getDiagnosticCategoryName(category: c_uint) -> CXString;
2101    pub fn clang_getDiagnosticCategoryText(diagnostic: CXDiagnostic) -> CXString;
2102    pub fn clang_getDiagnosticFixIt(diagnostic: CXDiagnostic, index: c_uint, range: *mut CXSourceRange) -> CXString;
2103    pub fn clang_getDiagnosticInSet(diagnostic: CXDiagnosticSet, index: c_uint) -> CXDiagnostic;
2104    pub fn clang_getDiagnosticLocation(diagnostic: CXDiagnostic) -> CXSourceLocation;
2105    pub fn clang_getDiagnosticNumFixIts(diagnostic: CXDiagnostic) -> c_uint;
2106    pub fn clang_getDiagnosticNumRanges(diagnostic: CXDiagnostic) -> c_uint;
2107    pub fn clang_getDiagnosticOption(diagnostic: CXDiagnostic, option: *mut CXString) -> CXString;
2108    pub fn clang_getDiagnosticRange(diagnostic: CXDiagnostic, index: c_uint) -> CXSourceRange;
2109    pub fn clang_getDiagnosticSetFromTU(tu: CXTranslationUnit) -> CXDiagnosticSet;
2110    pub fn clang_getDiagnosticSeverity(diagnostic: CXDiagnostic) -> CXDiagnosticSeverity;
2111    pub fn clang_getDiagnosticSpelling(diagnostic: CXDiagnostic) -> CXString;
2112    pub fn clang_getElementType(type_: CXType) -> CXType;
2113    pub fn clang_getEnumConstantDeclUnsignedValue(cursor: CXCursor) -> c_ulonglong;
2114    pub fn clang_getEnumConstantDeclValue(cursor: CXCursor) -> c_longlong;
2115    pub fn clang_getEnumDeclIntegerType(cursor: CXCursor) -> CXType;
2116    /// Only available on `libclang` 5.0 and later.
2117    #[cfg(feature = "clang_5_0")]
2118    pub fn clang_getExceptionSpecificationType(type_: CXType) -> CXCursor_ExceptionSpecificationKind;
2119    pub fn clang_getExpansionLocation(location: CXSourceLocation, file: *mut CXFile, line: *mut c_uint, column: *mut c_uint, offset: *mut c_uint);
2120    pub fn clang_getFieldDeclBitWidth(cursor: CXCursor) -> c_int;
2121    pub fn clang_getFile(tu: CXTranslationUnit, file: *const c_char) -> CXFile;
2122    /// Only available on `libclang` 6.0 and later.
2123    #[cfg(feature = "clang_6_0")]
2124    pub fn clang_getFileContents(tu: CXTranslationUnit, file: CXFile, size: *mut size_t) -> *const c_char;
2125    pub fn clang_getFileLocation(location: CXSourceLocation, file: *mut CXFile, line: *mut c_uint, column: *mut c_uint, offset: *mut c_uint);
2126    pub fn clang_getFileName(file: CXFile) -> CXString;
2127    pub fn clang_getFileTime(file: CXFile) -> time_t;
2128    pub fn clang_getFileUniqueID(file: CXFile, id: *mut CXFileUniqueID) -> c_int;
2129    pub fn clang_getFunctionTypeCallingConv(type_: CXType) -> CXCallingConv;
2130    pub fn clang_getIBOutletCollectionType(cursor: CXCursor) -> CXType;
2131    pub fn clang_getIncludedFile(cursor: CXCursor) -> CXFile;
2132    pub fn clang_getInclusions(tu: CXTranslationUnit, visitor: CXInclusionVisitor, data: CXClientData);
2133    pub fn clang_getInstantiationLocation(location: CXSourceLocation, file: *mut CXFile, line: *mut c_uint, column: *mut c_uint, offset: *mut c_uint);
2134    pub fn clang_getLocation(tu: CXTranslationUnit, file: CXFile, line: c_uint, column: c_uint) -> CXSourceLocation;
2135    pub fn clang_getLocationForOffset(tu: CXTranslationUnit, file: CXFile, offset: c_uint) -> CXSourceLocation;
2136    pub fn clang_getModuleForFile(tu: CXTranslationUnit, file: CXFile) -> CXModule;
2137    pub fn clang_getNullCursor() -> CXCursor;
2138    pub fn clang_getNullLocation() -> CXSourceLocation;
2139    pub fn clang_getNullRange() -> CXSourceRange;
2140    pub fn clang_getNumArgTypes(type_: CXType) -> c_int;
2141    pub fn clang_getNumCompletionChunks(string: CXCompletionString) -> c_uint;
2142    pub fn clang_getNumDiagnostics(tu: CXTranslationUnit) -> c_uint;
2143    pub fn clang_getNumDiagnosticsInSet(diagnostic: CXDiagnosticSet) -> c_uint;
2144    pub fn clang_getNumElements(type_: CXType) -> c_longlong;
2145    pub fn clang_getNumOverloadedDecls(cursor: CXCursor) -> c_uint;
2146    pub fn clang_getOverloadedDecl(cursor: CXCursor, index: c_uint) -> CXCursor;
2147    pub fn clang_getOverriddenCursors(cursor: CXCursor, cursors: *mut *mut CXCursor, n_cursors: *mut c_uint);
2148    pub fn clang_getPointeeType(type_: CXType) -> CXType;
2149    pub fn clang_getPresumedLocation(location: CXSourceLocation, file: *mut CXString, line: *mut c_uint, column: *mut c_uint);
2150    pub fn clang_getRange(start: CXSourceLocation, end: CXSourceLocation) -> CXSourceRange;
2151    pub fn clang_getRangeEnd(range: CXSourceRange) -> CXSourceLocation;
2152    pub fn clang_getRangeStart(range: CXSourceRange) -> CXSourceLocation;
2153    pub fn clang_getRemappings(file: *const c_char) -> CXRemapping;
2154    pub fn clang_getRemappingsFromFileList(files: *mut *const c_char, n_files: c_uint) -> CXRemapping;
2155    pub fn clang_getResultType(type_: CXType) -> CXType;
2156    pub fn clang_getSkippedRanges(tu: CXTranslationUnit, file: CXFile) -> *mut CXSourceRangeList;
2157    pub fn clang_getSpecializedCursorTemplate(cursor: CXCursor) -> CXCursor;
2158    pub fn clang_getSpellingLocation(location: CXSourceLocation, file: *mut CXFile, line: *mut c_uint, column: *mut c_uint, offset: *mut c_uint);
2159    pub fn clang_getTUResourceUsageName(kind: CXTUResourceUsageKind) -> *const c_char;
2160    pub fn clang_getTemplateCursorKind(cursor: CXCursor) -> CXCursorKind;
2161    pub fn clang_getToken(tu: CXTranslationUnit, location: CXSourceLocation) -> *mut CXToken;
2162    pub fn clang_getTokenExtent(tu: CXTranslationUnit, token: CXToken) -> CXSourceRange;
2163    pub fn clang_getTokenKind(token: CXToken) -> CXTokenKind;
2164    pub fn clang_getTokenLocation(tu: CXTranslationUnit, token: CXToken) -> CXSourceLocation;
2165    pub fn clang_getTokenSpelling(tu: CXTranslationUnit, token: CXToken) -> CXString;
2166    pub fn clang_getTranslationUnitCursor(tu: CXTranslationUnit) -> CXCursor;
2167    pub fn clang_getTranslationUnitSpelling(tu: CXTranslationUnit) -> CXString;
2168    /// Only available on `libclang` 5.0 and later.
2169    #[cfg(feature = "clang_5_0")]
2170    pub fn clang_getTranslationUnitTargetInfo(tu: CXTranslationUnit) -> CXTargetInfo;
2171    /// Only available on `libclang` 16.0 and later.
2172    #[cfg(feature = "clang_16_0")]
2173    pub fn clang_getUnqualifiedType(type_: CXType) -> CXType;
2174    /// Only available on `libclang` 16.0 and later.
2175    #[cfg(feature = "clang_16_0")]
2176    pub fn clang_getNonReferenceType(type_: CXType) -> CXType;
2177    pub fn clang_getTypeDeclaration(type_: CXType) -> CXCursor;
2178    pub fn clang_getTypeKindSpelling(type_: CXTypeKind) -> CXString;
2179    pub fn clang_getTypeSpelling(type_: CXType) -> CXString;
2180    pub fn clang_getTypedefDeclUnderlyingType(cursor: CXCursor) -> CXType;
2181    /// Only available on `libclang` 5.0 and later.
2182    #[cfg(feature = "clang_5_0")]
2183    pub fn clang_getTypedefName(type_: CXType) -> CXString;
2184    pub fn clang_hashCursor(cursor: CXCursor) -> c_uint;
2185    pub fn clang_indexLoc_getCXSourceLocation(location: CXIdxLoc) -> CXSourceLocation;
2186    pub fn clang_indexLoc_getFileLocation(location: CXIdxLoc, index_file: *mut CXIdxClientFile, file: *mut CXFile, line: *mut c_uint, column: *mut c_uint, offset: *mut c_uint);
2187    pub fn clang_indexSourceFile(index: CXIndexAction, data: CXClientData, callbacks: *mut IndexerCallbacks, n_callbacks: c_uint, index_flags: CXIndexOptFlags, file: *const c_char, arguments: *const *const c_char, n_arguments: c_int, unsaved: *mut CXUnsavedFile, n_unsaved: c_uint, tu: *mut CXTranslationUnit, tu_flags: CXTranslationUnit_Flags) -> CXErrorCode;
2188    /// Only available on `libclang` 3.8 and later.
2189    #[cfg(feature = "clang_3_8")]
2190    pub fn clang_indexSourceFileFullArgv(index: CXIndexAction, data: CXClientData, callbacks: *mut IndexerCallbacks, n_callbacks: c_uint, index_flags: CXIndexOptFlags, file: *const c_char, arguments: *const *const c_char, n_arguments: c_int, unsaved: *mut CXUnsavedFile, n_unsaved: c_uint, tu: *mut CXTranslationUnit, tu_flags: CXTranslationUnit_Flags) -> CXErrorCode;
2191    pub fn clang_indexTranslationUnit(index: CXIndexAction, data: CXClientData, callbacks: *mut IndexerCallbacks, n_callbacks: c_uint, flags: CXIndexOptFlags, tu: CXTranslationUnit) -> c_int;
2192    pub fn clang_index_getCXXClassDeclInfo(info: *const CXIdxDeclInfo) -> *const CXIdxCXXClassDeclInfo;
2193    pub fn clang_index_getClientContainer(info: *const CXIdxContainerInfo) -> CXIdxClientContainer;
2194    pub fn clang_index_getClientEntity(info: *const CXIdxEntityInfo) -> CXIdxClientEntity;
2195    pub fn clang_index_getIBOutletCollectionAttrInfo(info: *const CXIdxAttrInfo) -> *const CXIdxIBOutletCollectionAttrInfo;
2196    pub fn clang_index_getObjCCategoryDeclInfo(info: *const CXIdxDeclInfo) -> *const CXIdxObjCCategoryDeclInfo;
2197    pub fn clang_index_getObjCContainerDeclInfo(info: *const CXIdxDeclInfo) -> *const CXIdxObjCContainerDeclInfo;
2198    pub fn clang_index_getObjCInterfaceDeclInfo(info: *const CXIdxDeclInfo) -> *const CXIdxObjCInterfaceDeclInfo;
2199    pub fn clang_index_getObjCPropertyDeclInfo(info: *const CXIdxDeclInfo) -> *const CXIdxObjCPropertyDeclInfo;
2200    pub fn clang_index_getObjCProtocolRefListInfo(info: *const CXIdxDeclInfo) -> *const CXIdxObjCProtocolRefListInfo;
2201    pub fn clang_index_isEntityObjCContainerKind(info: CXIdxEntityKind) -> c_int;
2202    pub fn clang_index_setClientContainer(info: *const CXIdxContainerInfo, container: CXIdxClientContainer);
2203    pub fn clang_index_setClientEntity(info: *const CXIdxEntityInfo, entity: CXIdxClientEntity);
2204    pub fn clang_isAttribute(kind: CXCursorKind) -> c_uint;
2205    pub fn clang_isConstQualifiedType(type_: CXType) -> c_uint;
2206    pub fn clang_isCursorDefinition(cursor: CXCursor) -> c_uint;
2207    pub fn clang_isDeclaration(kind: CXCursorKind) -> c_uint;
2208    pub fn clang_isExpression(kind: CXCursorKind) -> c_uint;
2209    pub fn clang_isFileMultipleIncludeGuarded(tu: CXTranslationUnit, file: CXFile) -> c_uint;
2210    pub fn clang_isFunctionTypeVariadic(type_: CXType) -> c_uint;
2211    pub fn clang_isInvalid(kind: CXCursorKind) -> c_uint;
2212    /// Only available on `libclang` 7.0 and later.
2213    #[cfg(feature = "clang_7_0")]
2214    pub fn clang_isInvalidDeclaration(cursor: CXCursor) -> c_uint;
2215    pub fn clang_isPODType(type_: CXType) -> c_uint;
2216    pub fn clang_isPreprocessing(kind: CXCursorKind) -> c_uint;
2217    pub fn clang_isReference(kind: CXCursorKind) -> c_uint;
2218    pub fn clang_isRestrictQualifiedType(type_: CXType) -> c_uint;
2219    pub fn clang_isStatement(kind: CXCursorKind) -> c_uint;
2220    pub fn clang_isTranslationUnit(kind: CXCursorKind) -> c_uint;
2221    pub fn clang_isUnexposed(kind: CXCursorKind) -> c_uint;
2222    pub fn clang_isVirtualBase(cursor: CXCursor) -> c_uint;
2223    pub fn clang_isVolatileQualifiedType(type_: CXType) -> c_uint;
2224    pub fn clang_loadDiagnostics(file: *const c_char, error: *mut CXLoadDiag_Error, message: *mut CXString) -> CXDiagnosticSet;
2225    pub fn clang_parseTranslationUnit(index: CXIndex, file: *const c_char, arguments: *const *const c_char, n_arguments: c_int, unsaved: *mut CXUnsavedFile, n_unsaved: c_uint, flags: CXTranslationUnit_Flags) -> CXTranslationUnit;
2226    pub fn clang_parseTranslationUnit2(index: CXIndex, file: *const c_char, arguments: *const *const c_char, n_arguments: c_int, unsaved: *mut CXUnsavedFile, n_unsaved: c_uint, flags: CXTranslationUnit_Flags, tu: *mut CXTranslationUnit) -> CXErrorCode;
2227    /// Only available on `libclang` 3.8 and later.
2228    #[cfg(feature = "clang_3_8")]
2229    pub fn clang_parseTranslationUnit2FullArgv(index: CXIndex, file: *const c_char, arguments: *const *const c_char, n_arguments: c_int, unsaved: *mut CXUnsavedFile, n_unsaved: c_uint, flags: CXTranslationUnit_Flags, tu: *mut CXTranslationUnit) -> CXErrorCode;
2230    pub fn clang_remap_dispose(remapping: CXRemapping);
2231    pub fn clang_remap_getFilenames(remapping: CXRemapping, index: c_uint, original: *mut CXString, transformed: *mut CXString);
2232    pub fn clang_remap_getNumFiles(remapping: CXRemapping) -> c_uint;
2233    pub fn clang_reparseTranslationUnit(tu: CXTranslationUnit, n_unsaved: c_uint, unsaved: *mut CXUnsavedFile, flags: CXReparse_Flags) -> CXErrorCode;
2234    pub fn clang_saveTranslationUnit(tu: CXTranslationUnit, file: *const c_char, options: CXSaveTranslationUnit_Flags) -> CXSaveError;
2235    pub fn clang_sortCodeCompletionResults(results: *mut CXCompletionResult, n_results: c_uint);
2236    /// Only available on `libclang` 5.0 and later.
2237    #[cfg(feature = "clang_5_0")]
2238    pub fn clang_suspendTranslationUnit(tu: CXTranslationUnit) -> c_uint;
2239    pub fn clang_toggleCrashRecovery(recovery: c_uint);
2240    pub fn clang_tokenize(tu: CXTranslationUnit, range: CXSourceRange, tokens: *mut *mut CXToken, n_tokens: *mut c_uint);
2241    pub fn clang_visitChildren(cursor: CXCursor, visitor: CXCursorVisitor, data: CXClientData) -> c_uint;
2242
2243    // Documentation
2244    pub fn clang_BlockCommandComment_getArgText(comment: CXComment, index: c_uint) -> CXString;
2245    pub fn clang_BlockCommandComment_getCommandName(comment: CXComment) -> CXString;
2246    pub fn clang_BlockCommandComment_getNumArgs(comment: CXComment) -> c_uint;
2247    pub fn clang_BlockCommandComment_getParagraph(comment: CXComment) -> CXComment;
2248    pub fn clang_Comment_getChild(comment: CXComment, index: c_uint) -> CXComment;
2249    pub fn clang_Comment_getKind(comment: CXComment) -> CXCommentKind;
2250    pub fn clang_Comment_getNumChildren(comment: CXComment) -> c_uint;
2251    pub fn clang_Comment_isWhitespace(comment: CXComment) -> c_uint;
2252    pub fn clang_Cursor_getParsedComment(C: CXCursor) -> CXComment;
2253    pub fn clang_FullComment_getAsHTML(comment: CXComment) -> CXString;
2254    pub fn clang_FullComment_getAsXML(comment: CXComment) -> CXString;
2255    pub fn clang_HTMLStartTag_getAttrName(comment: CXComment, index: c_uint) -> CXString;
2256    pub fn clang_HTMLStartTag_getAttrValue(comment: CXComment, index: c_uint) -> CXString;
2257    pub fn clang_HTMLStartTag_getNumAttrs(comment: CXComment) -> c_uint;
2258    pub fn clang_HTMLStartTagComment_isSelfClosing(comment: CXComment) -> c_uint;
2259    pub fn clang_HTMLTagComment_getAsString(comment: CXComment) -> CXString;
2260    pub fn clang_HTMLTagComment_getTagName(comment: CXComment) -> CXString;
2261    pub fn clang_InlineCommandComment_getArgText(comment: CXComment, index: c_uint) -> CXString;
2262    pub fn clang_InlineCommandComment_getCommandName(comment: CXComment) -> CXString;
2263    pub fn clang_InlineCommandComment_getNumArgs(comment: CXComment) -> c_uint;
2264    pub fn clang_InlineCommandComment_getRenderKind(comment: CXComment) -> CXCommentInlineCommandRenderKind;
2265    pub fn clang_InlineContentComment_hasTrailingNewline(comment: CXComment) -> c_uint;
2266    pub fn clang_ParamCommandComment_getDirection(comment: CXComment) -> CXCommentParamPassDirection;
2267    pub fn clang_ParamCommandComment_getParamIndex(comment: CXComment) -> c_uint;
2268    pub fn clang_ParamCommandComment_getParamName(comment: CXComment) -> CXString;
2269    pub fn clang_ParamCommandComment_isDirectionExplicit(comment: CXComment) -> c_uint;
2270    pub fn clang_ParamCommandComment_isParamIndexValid(comment: CXComment) -> c_uint;
2271    pub fn clang_TextComment_getText(comment: CXComment) -> CXString;
2272    pub fn clang_TParamCommandComment_getDepth(comment: CXComment) -> c_uint;
2273    pub fn clang_TParamCommandComment_getIndex(comment: CXComment, depth: c_uint) -> c_uint;
2274    pub fn clang_TParamCommandComment_getParamName(comment: CXComment) -> CXString;
2275    pub fn clang_TParamCommandComment_isParamPositionValid(comment: CXComment) -> c_uint;
2276    pub fn clang_VerbatimBlockLineComment_getText(comment: CXComment) -> CXString;
2277    pub fn clang_VerbatimLineComment_getText(comment: CXComment) -> CXString;
2278}
2279