clang_sys/
lib.rs

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