Skip to main content

clang_sys/
lib.rs

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