blob: ea2ffc2f112e25ecf76f071dde542f20314f5cbd [file] [log] [blame]
Chih-Hung Hsiehfab43802020-04-07 14:24:01 -07001// 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;
Haibo Huang8b9513e2020-07-13 22:05:39 -070051#[cfg(feature = "clang_3_7")]
Chih-Hung Hsiehfab43802020-04-07 14:24:01 -070052pub 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,
Haibo Huang8b9513e2020-07-13 22:05:39 -0700441 /// 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,
Chih-Hung Hsiehfab43802020-04-07 14:24:01 -0700451 const CXCursor_TranslationUnit = 300,
452 const CXCursor_UnexposedAttr = 400,
453 const CXCursor_IBActionAttr = 401,
454 const CXCursor_IBOutletAttr = 402,
455 const CXCursor_IBOutletCollectionAttr = 403,
456 const CXCursor_CXXFinalAttr = 404,
457 const CXCursor_CXXOverrideAttr = 405,
458 const CXCursor_AnnotateAttr = 406,
459 const CXCursor_AsmLabelAttr = 407,
460 const CXCursor_PackedAttr = 408,
461 const CXCursor_PureAttr = 409,
462 const CXCursor_ConstAttr = 410,
463 const CXCursor_NoDuplicateAttr = 411,
464 const CXCursor_CUDAConstantAttr = 412,
465 const CXCursor_CUDADeviceAttr = 413,
466 const CXCursor_CUDAGlobalAttr = 414,
467 const CXCursor_CUDAHostAttr = 415,
468 /// Only produced by `libclang` 3.6 and later.
469 const CXCursor_CUDASharedAttr = 416,
470 /// Only produced by `libclang` 3.8 and later.
471 const CXCursor_VisibilityAttr = 417,
472 /// Only produced by `libclang` 3.8 and later.
473 const CXCursor_DLLExport = 418,
474 /// Only produced by `libclang` 3.8 and later.
475 const CXCursor_DLLImport = 419,
476 /// Only produced by `libclang` 8.0 and later.
477 const CXCursor_NSReturnsRetained = 420,
478 /// Only produced by `libclang` 8.0 and later.
479 const CXCursor_NSReturnsNotRetained = 421,
480 /// Only produced by `libclang` 8.0 and later.
481 const CXCursor_NSReturnsAutoreleased = 422,
482 /// Only produced by `libclang` 8.0 and later.
483 const CXCursor_NSConsumesSelf = 423,
484 /// Only produced by `libclang` 8.0 and later.
485 const CXCursor_NSConsumed = 424,
486 /// Only produced by `libclang` 8.0 and later.
487 const CXCursor_ObjCException = 425,
488 /// Only produced by `libclang` 8.0 and later.
489 const CXCursor_ObjCNSObject = 426,
490 /// Only produced by `libclang` 8.0 and later.
491 const CXCursor_ObjCIndependentClass = 427,
492 /// Only produced by `libclang` 8.0 and later.
493 const CXCursor_ObjCPreciseLifetime = 428,
494 /// Only produced by `libclang` 8.0 and later.
495 const CXCursor_ObjCReturnsInnerPointer = 429,
496 /// Only produced by `libclang` 8.0 and later.
497 const CXCursor_ObjCRequiresSuper = 430,
498 /// Only produced by `libclang` 8.0 and later.
499 const CXCursor_ObjCRootClass = 431,
500 /// Only produced by `libclang` 8.0 and later.
501 const CXCursor_ObjCSubclassingRestricted = 432,
502 /// Only produced by `libclang` 8.0 and later.
503 const CXCursor_ObjCExplicitProtocolImpl = 433,
504 /// Only produced by `libclang` 8.0 and later.
505 const CXCursor_ObjCDesignatedInitializer = 434,
506 /// Only produced by `libclang` 8.0 and later.
507 const CXCursor_ObjCRuntimeVisible = 435,
508 /// Only produced by `libclang` 8.0 and later.
509 const CXCursor_ObjCBoxable = 436,
510 /// Only produced by `libclang` 8.0 and later.
511 const CXCursor_FlagEnum = 437,
512 /// Only produced by `libclang` 9.0 and later.
513 const CXCursor_ConvergentAttr = 438,
514 /// Only produced by `libclang` 9.0 and later.
515 const CXCursor_WarnUnusedAttr = 439,
516 /// Only produced by `libclang` 9.0 and later.
517 const CXCursor_WarnUnusedResultAttr = 440,
518 /// Only produced by `libclang` 9.0 and later.
519 const CXCursor_AlignedAttr = 441,
520 const CXCursor_PreprocessingDirective = 500,
521 const CXCursor_MacroDefinition = 501,
522 /// Duplicate of `CXCursor_MacroInstantiation`.
523 const CXCursor_MacroExpansion = 502,
524 const CXCursor_InclusionDirective = 503,
525 const CXCursor_ModuleImportDecl = 600,
526 /// Only produced by `libclang` 3.8 and later.
527 const CXCursor_TypeAliasTemplateDecl = 601,
528 /// Only produced by `libclang` 3.9 and later.
529 const CXCursor_StaticAssert = 602,
530 /// Only produced by `libclang` 4.0 and later.
531 const CXCursor_FriendDecl = 603,
532 /// Only produced by `libclang` 3.7 and later.
533 const CXCursor_OverloadCandidate = 700,
534 }
535}
536
537cenum! {
538 /// Only available on `libclang` 5.0 and later.
Haibo Huang8b9513e2020-07-13 22:05:39 -0700539 #[cfg(feature = "clang_5_0")]
Chih-Hung Hsiehfab43802020-04-07 14:24:01 -0700540 enum CXCursor_ExceptionSpecificationKind {
541 const CXCursor_ExceptionSpecificationKind_None = 0,
542 const CXCursor_ExceptionSpecificationKind_DynamicNone = 1,
543 const CXCursor_ExceptionSpecificationKind_Dynamic = 2,
544 const CXCursor_ExceptionSpecificationKind_MSAny = 3,
545 const CXCursor_ExceptionSpecificationKind_BasicNoexcept = 4,
546 const CXCursor_ExceptionSpecificationKind_ComputedNoexcept = 5,
547 const CXCursor_ExceptionSpecificationKind_Unevaluated = 6,
548 const CXCursor_ExceptionSpecificationKind_Uninstantiated = 7,
549 const CXCursor_ExceptionSpecificationKind_Unparsed = 8,
550 /// Only available on `libclang` 9.0 and later.
Haibo Huang8b9513e2020-07-13 22:05:39 -0700551 #[cfg(feature = "clang_9_0")]
Chih-Hung Hsiehfab43802020-04-07 14:24:01 -0700552 const CXCursor_ExceptionSpecificationKind_NoThrow = 9,
553 }
554}
555
556cenum! {
557 enum CXDiagnosticSeverity {
558 const CXDiagnostic_Ignored = 0,
559 const CXDiagnostic_Note = 1,
560 const CXDiagnostic_Warning = 2,
561 const CXDiagnostic_Error = 3,
562 const CXDiagnostic_Fatal = 4,
563 }
564}
565
566cenum! {
567 enum CXErrorCode {
568 const CXError_Success = 0,
569 const CXError_Failure = 1,
570 const CXError_Crashed = 2,
571 const CXError_InvalidArguments = 3,
572 const CXError_ASTReadError = 4,
573 }
574}
575
576cenum! {
577 enum CXEvalResultKind {
578 const CXEval_UnExposed = 0,
579 const CXEval_Int = 1 ,
580 const CXEval_Float = 2,
581 const CXEval_ObjCStrLiteral = 3,
582 const CXEval_StrLiteral = 4,
583 const CXEval_CFStr = 5,
584 const CXEval_Other = 6,
585 }
586}
587
588cenum! {
589 enum CXIdxAttrKind {
590 const CXIdxAttr_Unexposed = 0,
591 const CXIdxAttr_IBAction = 1,
592 const CXIdxAttr_IBOutlet = 2,
593 const CXIdxAttr_IBOutletCollection = 3,
594 }
595}
596
597cenum! {
598 enum CXIdxEntityCXXTemplateKind {
599 const CXIdxEntity_NonTemplate = 0,
600 const CXIdxEntity_Template = 1,
601 const CXIdxEntity_TemplatePartialSpecialization = 2,
602 const CXIdxEntity_TemplateSpecialization = 3,
603 }
604}
605
606cenum! {
607 enum CXIdxEntityKind {
608 const CXIdxEntity_Unexposed = 0,
609 const CXIdxEntity_Typedef = 1,
610 const CXIdxEntity_Function = 2,
611 const CXIdxEntity_Variable = 3,
612 const CXIdxEntity_Field = 4,
613 const CXIdxEntity_EnumConstant = 5,
614 const CXIdxEntity_ObjCClass = 6,
615 const CXIdxEntity_ObjCProtocol = 7,
616 const CXIdxEntity_ObjCCategory = 8,
617 const CXIdxEntity_ObjCInstanceMethod = 9,
618 const CXIdxEntity_ObjCClassMethod = 10,
619 const CXIdxEntity_ObjCProperty = 11,
620 const CXIdxEntity_ObjCIvar = 12,
621 const CXIdxEntity_Enum = 13,
622 const CXIdxEntity_Struct = 14,
623 const CXIdxEntity_Union = 15,
624 const CXIdxEntity_CXXClass = 16,
625 const CXIdxEntity_CXXNamespace = 17,
626 const CXIdxEntity_CXXNamespaceAlias = 18,
627 const CXIdxEntity_CXXStaticVariable = 19,
628 const CXIdxEntity_CXXStaticMethod = 20,
629 const CXIdxEntity_CXXInstanceMethod = 21,
630 const CXIdxEntity_CXXConstructor = 22,
631 const CXIdxEntity_CXXDestructor = 23,
632 const CXIdxEntity_CXXConversionFunction = 24,
633 const CXIdxEntity_CXXTypeAlias = 25,
634 const CXIdxEntity_CXXInterface = 26,
635 }
636}
637
638cenum! {
639 enum CXIdxEntityLanguage {
640 const CXIdxEntityLang_None = 0,
641 const CXIdxEntityLang_C = 1,
642 const CXIdxEntityLang_ObjC = 2,
643 const CXIdxEntityLang_CXX = 3,
644 /// Only produced by `libclang` 5.0 and later.
645 const CXIdxEntityLang_Swift = 4,
646 }
647}
648
649cenum! {
650 enum CXIdxEntityRefKind {
651 const CXIdxEntityRef_Direct = 1,
652 const CXIdxEntityRef_Implicit = 2,
653 }
654}
655
656cenum! {
657 enum CXIdxObjCContainerKind {
658 const CXIdxObjCContainer_ForwardRef = 0,
659 const CXIdxObjCContainer_Interface = 1,
660 const CXIdxObjCContainer_Implementation = 2,
661 }
662}
663
664cenum! {
665 enum CXLanguageKind {
666 const CXLanguage_Invalid = 0,
667 const CXLanguage_C = 1,
668 const CXLanguage_ObjC = 2,
669 const CXLanguage_CPlusPlus = 3,
670 }
671}
672
673cenum! {
674 enum CXLinkageKind {
675 const CXLinkage_Invalid = 0,
676 const CXLinkage_NoLinkage = 1,
677 const CXLinkage_Internal = 2,
678 const CXLinkage_UniqueExternal = 3,
679 const CXLinkage_External = 4,
680 }
681}
682
683cenum! {
684 enum CXLoadDiag_Error {
685 const CXLoadDiag_None = 0,
686 const CXLoadDiag_Unknown = 1,
687 const CXLoadDiag_CannotLoad = 2,
688 const CXLoadDiag_InvalidFile = 3,
689 }
690}
691
692cenum! {
693 /// Only available on `libclang` 7.0 and later.
Haibo Huang8b9513e2020-07-13 22:05:39 -0700694 #[cfg(feature = "clang_7_0")]
Chih-Hung Hsiehfab43802020-04-07 14:24:01 -0700695 enum CXPrintingPolicyProperty {
696 const CXPrintingPolicy_Indentation = 0,
697 const CXPrintingPolicy_SuppressSpecifiers = 1,
698 const CXPrintingPolicy_SuppressTagKeyword = 2,
699 const CXPrintingPolicy_IncludeTagDefinition = 3,
700 const CXPrintingPolicy_SuppressScope = 4,
701 const CXPrintingPolicy_SuppressUnwrittenScope = 5,
702 const CXPrintingPolicy_SuppressInitializers = 6,
703 const CXPrintingPolicy_ConstantArraySizeAsWritten = 7,
704 const CXPrintingPolicy_AnonymousTagLocations = 8,
705 const CXPrintingPolicy_SuppressStrongLifetime = 9,
706 const CXPrintingPolicy_SuppressLifetimeQualifiers = 10,
707 const CXPrintingPolicy_SuppressTemplateArgsInCXXConstructors = 11,
708 const CXPrintingPolicy_Bool = 12,
709 const CXPrintingPolicy_Restrict = 13,
710 const CXPrintingPolicy_Alignof = 14,
711 const CXPrintingPolicy_UnderscoreAlignof = 15,
712 const CXPrintingPolicy_UseVoidForZeroParams = 16,
713 const CXPrintingPolicy_TerseOutput = 17,
714 const CXPrintingPolicy_PolishForDeclaration = 18,
715 const CXPrintingPolicy_Half = 19,
716 const CXPrintingPolicy_MSWChar = 20,
717 const CXPrintingPolicy_IncludeNewlines = 21,
718 const CXPrintingPolicy_MSVCFormatting = 22,
719 const CXPrintingPolicy_ConstantsAsWritten = 23,
720 const CXPrintingPolicy_SuppressImplicitBase = 24,
721 const CXPrintingPolicy_FullyQualifiedName = 25,
722 }
723}
724
725cenum! {
726 enum CXRefQualifierKind {
727 const CXRefQualifier_None = 0,
728 const CXRefQualifier_LValue = 1,
729 const CXRefQualifier_RValue = 2,
730 }
731}
732
733cenum! {
734 enum CXResult {
735 const CXResult_Success = 0,
736 const CXResult_Invalid = 1,
737 const CXResult_VisitBreak = 2,
738 }
739}
740
741cenum! {
742 enum CXSaveError {
743 const CXSaveError_None = 0,
744 const CXSaveError_Unknown = 1,
745 const CXSaveError_TranslationErrors = 2,
746 const CXSaveError_InvalidTU = 3,
747 }
748}
749
750cenum! {
751 /// Only available on `libclang` 6.0 and later.
Haibo Huang8b9513e2020-07-13 22:05:39 -0700752 #[cfg(feature = "clang_6_0")]
Chih-Hung Hsiehfab43802020-04-07 14:24:01 -0700753 enum CXTLSKind {
754 const CXTLS_None = 0,
755 const CXTLS_Dynamic = 1,
756 const CXTLS_Static = 2,
757 }
758}
759
760cenum! {
761 enum CXTUResourceUsageKind {
762 const CXTUResourceUsage_AST = 1,
763 const CXTUResourceUsage_Identifiers = 2,
764 const CXTUResourceUsage_Selectors = 3,
765 const CXTUResourceUsage_GlobalCompletionResults = 4,
766 const CXTUResourceUsage_SourceManagerContentCache = 5,
767 const CXTUResourceUsage_AST_SideTables = 6,
768 const CXTUResourceUsage_SourceManager_Membuffer_Malloc = 7,
769 const CXTUResourceUsage_SourceManager_Membuffer_MMap = 8,
770 const CXTUResourceUsage_ExternalASTSource_Membuffer_Malloc = 9,
771 const CXTUResourceUsage_ExternalASTSource_Membuffer_MMap = 10,
772 const CXTUResourceUsage_Preprocessor = 11,
773 const CXTUResourceUsage_PreprocessingRecord = 12,
774 const CXTUResourceUsage_SourceManager_DataStructures = 13,
775 const CXTUResourceUsage_Preprocessor_HeaderSearch = 14,
776 }
777}
778
779cenum! {
780 /// Only available on `libclang` 3.6 and later.
Haibo Huang8b9513e2020-07-13 22:05:39 -0700781 #[cfg(feature = "clang_3_6")]
Chih-Hung Hsiehfab43802020-04-07 14:24:01 -0700782 enum CXTemplateArgumentKind {
783 const CXTemplateArgumentKind_Null = 0,
784 const CXTemplateArgumentKind_Type = 1,
785 const CXTemplateArgumentKind_Declaration = 2,
786 const CXTemplateArgumentKind_NullPtr = 3,
787 const CXTemplateArgumentKind_Integral = 4,
788 const CXTemplateArgumentKind_Template = 5,
789 const CXTemplateArgumentKind_TemplateExpansion = 6,
790 const CXTemplateArgumentKind_Expression = 7,
791 const CXTemplateArgumentKind_Pack = 8,
792 const CXTemplateArgumentKind_Invalid = 9,
793 }
794}
795
796cenum! {
797 enum CXTokenKind {
798 const CXToken_Punctuation = 0,
799 const CXToken_Keyword = 1,
800 const CXToken_Identifier = 2,
801 const CXToken_Literal = 3,
802 const CXToken_Comment = 4,
803 }
804}
805
806cenum! {
807 enum CXTypeKind {
808 const CXType_Invalid = 0,
809 const CXType_Unexposed = 1,
810 const CXType_Void = 2,
811 const CXType_Bool = 3,
812 const CXType_Char_U = 4,
813 const CXType_UChar = 5,
814 const CXType_Char16 = 6,
815 const CXType_Char32 = 7,
816 const CXType_UShort = 8,
817 const CXType_UInt = 9,
818 const CXType_ULong = 10,
819 const CXType_ULongLong = 11,
820 const CXType_UInt128 = 12,
821 const CXType_Char_S = 13,
822 const CXType_SChar = 14,
823 const CXType_WChar = 15,
824 const CXType_Short = 16,
825 const CXType_Int = 17,
826 const CXType_Long = 18,
827 const CXType_LongLong = 19,
828 const CXType_Int128 = 20,
829 const CXType_Float = 21,
830 const CXType_Double = 22,
831 const CXType_LongDouble = 23,
832 const CXType_NullPtr = 24,
833 const CXType_Overload = 25,
834 const CXType_Dependent = 26,
835 const CXType_ObjCId = 27,
836 const CXType_ObjCClass = 28,
837 const CXType_ObjCSel = 29,
838 /// Only produced by `libclang` 3.9 and later.
839 const CXType_Float128 = 30,
840 /// Only produced by `libclang` 5.0 and later.
841 const CXType_Half = 31,
842 /// Only produced by `libclang` 6.0 and later.
843 const CXType_Float16 = 32,
844 /// Only produced by `libclang` 7.0 and later.
845 const CXType_ShortAccum = 33,
846 /// Only produced by `libclang` 7.0 and later.
847 const CXType_Accum = 34,
848 /// Only produced by `libclang` 7.0 and later.
849 const CXType_LongAccum = 35,
850 /// Only produced by `libclang` 7.0 and later.
851 const CXType_UShortAccum = 36,
852 /// Only produced by `libclang` 7.0 and later.
853 const CXType_UAccum = 37,
854 /// Only produced by `libclang` 7.0 and later.
855 const CXType_ULongAccum = 38,
856 const CXType_Complex = 100,
857 const CXType_Pointer = 101,
858 const CXType_BlockPointer = 102,
859 const CXType_LValueReference = 103,
860 const CXType_RValueReference = 104,
861 const CXType_Record = 105,
862 const CXType_Enum = 106,
863 const CXType_Typedef = 107,
864 const CXType_ObjCInterface = 108,
865 const CXType_ObjCObjectPointer = 109,
866 const CXType_FunctionNoProto = 110,
867 const CXType_FunctionProto = 111,
868 const CXType_ConstantArray = 112,
869 const CXType_Vector = 113,
870 const CXType_IncompleteArray = 114,
871 const CXType_VariableArray = 115,
872 const CXType_DependentSizedArray = 116,
873 const CXType_MemberPointer = 117,
874 /// Only produced by `libclang` 3.8 and later.
875 const CXType_Auto = 118,
876 /// Only produced by `libclang` 3.9 and later.
877 const CXType_Elaborated = 119,
878 /// Only produced by `libclang` 5.0 and later.
879 const CXType_Pipe = 120,
880 /// Only produced by `libclang` 5.0 and later.
881 const CXType_OCLImage1dRO = 121,
882 /// Only produced by `libclang` 5.0 and later.
883 const CXType_OCLImage1dArrayRO = 122,
884 /// Only produced by `libclang` 5.0 and later.
885 const CXType_OCLImage1dBufferRO = 123,
886 /// Only produced by `libclang` 5.0 and later.
887 const CXType_OCLImage2dRO = 124,
888 /// Only produced by `libclang` 5.0 and later.
889 const CXType_OCLImage2dArrayRO = 125,
890 /// Only produced by `libclang` 5.0 and later.
891 const CXType_OCLImage2dDepthRO = 126,
892 /// Only produced by `libclang` 5.0 and later.
893 const CXType_OCLImage2dArrayDepthRO = 127,
894 /// Only produced by `libclang` 5.0 and later.
895 const CXType_OCLImage2dMSAARO = 128,
896 /// Only produced by `libclang` 5.0 and later.
897 const CXType_OCLImage2dArrayMSAARO = 129,
898 /// Only produced by `libclang` 5.0 and later.
899 const CXType_OCLImage2dMSAADepthRO = 130,
900 /// Only produced by `libclang` 5.0 and later.
901 const CXType_OCLImage2dArrayMSAADepthRO = 131,
902 /// Only produced by `libclang` 5.0 and later.
903 const CXType_OCLImage3dRO = 132,
904 /// Only produced by `libclang` 5.0 and later.
905 const CXType_OCLImage1dWO = 133,
906 /// Only produced by `libclang` 5.0 and later.
907 const CXType_OCLImage1dArrayWO = 134,
908 /// Only produced by `libclang` 5.0 and later.
909 const CXType_OCLImage1dBufferWO = 135,
910 /// Only produced by `libclang` 5.0 and later.
911 const CXType_OCLImage2dWO = 136,
912 /// Only produced by `libclang` 5.0 and later.
913 const CXType_OCLImage2dArrayWO = 137,
914 /// Only produced by `libclang` 5.0 and later.
915 const CXType_OCLImage2dDepthWO = 138,
916 /// Only produced by `libclang` 5.0 and later.
917 const CXType_OCLImage2dArrayDepthWO = 139,
918 /// Only produced by `libclang` 5.0 and later.
919 const CXType_OCLImage2dMSAAWO = 140,
920 /// Only produced by `libclang` 5.0 and later.
921 const CXType_OCLImage2dArrayMSAAWO = 141,
922 /// Only produced by `libclang` 5.0 and later.
923 const CXType_OCLImage2dMSAADepthWO = 142,
924 /// Only produced by `libclang` 5.0 and later.
925 const CXType_OCLImage2dArrayMSAADepthWO = 143,
926 /// Only produced by `libclang` 5.0 and later.
927 const CXType_OCLImage3dWO = 144,
928 /// Only produced by `libclang` 5.0 and later.
929 const CXType_OCLImage1dRW = 145,
930 /// Only produced by `libclang` 5.0 and later.
931 const CXType_OCLImage1dArrayRW = 146,
932 /// Only produced by `libclang` 5.0 and later.
933 const CXType_OCLImage1dBufferRW = 147,
934 /// Only produced by `libclang` 5.0 and later.
935 const CXType_OCLImage2dRW = 148,
936 /// Only produced by `libclang` 5.0 and later.
937 const CXType_OCLImage2dArrayRW = 149,
938 /// Only produced by `libclang` 5.0 and later.
939 const CXType_OCLImage2dDepthRW = 150,
940 /// Only produced by `libclang` 5.0 and later.
941 const CXType_OCLImage2dArrayDepthRW = 151,
942 /// Only produced by `libclang` 5.0 and later.
943 const CXType_OCLImage2dMSAARW = 152,
944 /// Only produced by `libclang` 5.0 and later.
945 const CXType_OCLImage2dArrayMSAARW = 153,
946 /// Only produced by `libclang` 5.0 and later.
947 const CXType_OCLImage2dMSAADepthRW = 154,
948 /// Only produced by `libclang` 5.0 and later.
949 const CXType_OCLImage2dArrayMSAADepthRW = 155,
950 /// Only produced by `libclang` 5.0 and later.
951 const CXType_OCLImage3dRW = 156,
952 /// Only produced by `libclang` 5.0 and later.
953 const CXType_OCLSampler = 157,
954 /// Only produced by `libclang` 5.0 and later.
955 const CXType_OCLEvent = 158,
956 /// Only produced by `libclang` 5.0 and later.
957 const CXType_OCLQueue = 159,
958 /// Only produced by `libclang` 5.0 and later.
959 const CXType_OCLReserveID = 160,
960 /// Only produced by `libclang` 8.0 and later.
961 const CXType_ObjCObject = 161,
962 /// Only produced by `libclang` 8.0 and later.
963 const CXType_ObjCTypeParam = 162,
964 /// Only produced by `libclang` 8.0 and later.
965 const CXType_Attributed = 163,
966 /// Only produced by `libclang` 8.0 and later.
967 const CXType_OCLIntelSubgroupAVCMcePayload = 164,
968 /// Only produced by `libclang` 8.0 and later.
969 const CXType_OCLIntelSubgroupAVCImePayload = 165,
970 /// Only produced by `libclang` 8.0 and later.
971 const CXType_OCLIntelSubgroupAVCRefPayload = 166,
972 /// Only produced by `libclang` 8.0 and later.
973 const CXType_OCLIntelSubgroupAVCSicPayload = 167,
974 /// Only produced by `libclang` 8.0 and later.
975 const CXType_OCLIntelSubgroupAVCMceResult = 168,
976 /// Only produced by `libclang` 8.0 and later.
977 const CXType_OCLIntelSubgroupAVCImeResult = 169,
978 /// Only produced by `libclang` 8.0 and later.
979 const CXType_OCLIntelSubgroupAVCRefResult = 170,
980 /// Only produced by `libclang` 8.0 and later.
981 const CXType_OCLIntelSubgroupAVCSicResult = 171,
982 /// Only produced by `libclang` 8.0 and later.
983 const CXType_OCLIntelSubgroupAVCImeResultSingleRefStreamout = 172,
984 /// Only produced by `libclang` 8.0 and later.
985 const CXType_OCLIntelSubgroupAVCImeResultDualRefStreamout = 173,
986 /// Only produced by `libclang` 8.0 and later.
987 const CXType_OCLIntelSubgroupAVCImeSingleRefStreamin = 174,
988 /// Only produced by `libclang` 8.0 and later.
989 const CXType_OCLIntelSubgroupAVCImeDualRefStreamin = 175,
990 /// Only produced by `libclang` 9.0 and later.
991 const CXType_ExtVector = 176,
992 }
993}
994
995cenum! {
996 enum CXTypeLayoutError {
997 const CXTypeLayoutError_Invalid = -1,
998 const CXTypeLayoutError_Incomplete = -2,
999 const CXTypeLayoutError_Dependent = -3,
1000 const CXTypeLayoutError_NotConstantSize = -4,
1001 const CXTypeLayoutError_InvalidFieldName = -5,
1002 /// Only produced by `libclang` 9.0 and later.
1003 const CXTypeLayoutError_Undeduced = -6,
1004 }
1005}
1006
1007cenum! {
1008 /// Only available on `libclang` 3.8 and later.
Haibo Huang8b9513e2020-07-13 22:05:39 -07001009 #[cfg(feature = "clang_3_8")]
Chih-Hung Hsiehfab43802020-04-07 14:24:01 -07001010 enum CXVisibilityKind {
1011 const CXVisibility_Invalid = 0,
1012 const CXVisibility_Hidden = 1,
1013 const CXVisibility_Protected = 2,
1014 const CXVisibility_Default = 3,
1015 }
1016}
1017
1018cenum! {
1019 /// Only available on `libclang` 8.0 and later.
Haibo Huang8b9513e2020-07-13 22:05:39 -07001020 #[cfg(feature = "clang_8_0")]
Chih-Hung Hsiehfab43802020-04-07 14:24:01 -07001021 enum CXTypeNullabilityKind {
1022 const CXTypeNullability_NonNull = 0,
1023 const CXTypeNullability_Nullable = 1,
1024 const CXTypeNullability_Unspecified = 2,
1025 const CXTypeNullability_Invalid = 3,
1026 }
1027}
1028
1029cenum! {
1030 enum CXVisitorResult {
1031 const CXVisit_Break = 0,
1032 const CXVisit_Continue = 1,
1033 }
1034}
1035
1036cenum! {
1037 enum CX_CXXAccessSpecifier {
1038 const CX_CXXInvalidAccessSpecifier = 0,
1039 const CX_CXXPublic = 1,
1040 const CX_CXXProtected = 2,
1041 const CX_CXXPrivate = 3,
1042 }
1043}
1044
1045cenum! {
1046 /// Only available on `libclang` 3.6 and later.
Haibo Huang8b9513e2020-07-13 22:05:39 -07001047 #[cfg(feature = "clang_3_6")]
Chih-Hung Hsiehfab43802020-04-07 14:24:01 -07001048 enum CX_StorageClass {
1049 const CX_SC_Invalid = 0,
1050 const CX_SC_None = 1,
1051 const CX_SC_Extern = 2,
1052 const CX_SC_Static = 3,
1053 const CX_SC_PrivateExtern = 4,
1054 const CX_SC_OpenCLWorkGroupLocal = 5,
1055 const CX_SC_Auto = 6,
1056 const CX_SC_Register = 7,
1057 }
1058}
1059
1060//================================================
1061// Flags
1062//================================================
1063
1064cenum! {
1065 enum CXCodeComplete_Flags {
1066 const CXCodeComplete_IncludeMacros = 1;
1067 const CXCodeComplete_IncludeCodePatterns = 2;
1068 const CXCodeComplete_IncludeBriefComments = 4;
1069 const CXCodeComplete_SkipPreamble = 8;
1070 const CXCodeComplete_IncludeCompletionsWithFixIts = 16;
1071 }
1072}
1073
1074cenum! {
1075 enum CXCompletionContext {
1076 const CXCompletionContext_Unexposed = 0;
1077 const CXCompletionContext_AnyType = 1;
1078 const CXCompletionContext_AnyValue = 2;
1079 const CXCompletionContext_ObjCObjectValue = 4;
1080 const CXCompletionContext_ObjCSelectorValue = 8;
1081 const CXCompletionContext_CXXClassTypeValue = 16;
1082 const CXCompletionContext_DotMemberAccess = 32;
1083 const CXCompletionContext_ArrowMemberAccess = 64;
1084 const CXCompletionContext_ObjCPropertyAccess = 128;
1085 const CXCompletionContext_EnumTag = 256;
1086 const CXCompletionContext_UnionTag = 512;
1087 const CXCompletionContext_StructTag = 1024;
1088 const CXCompletionContext_ClassTag = 2048;
1089 const CXCompletionContext_Namespace = 4096;
1090 const CXCompletionContext_NestedNameSpecifier = 8192;
1091 const CXCompletionContext_ObjCInterface = 16384;
1092 const CXCompletionContext_ObjCProtocol = 32768;
1093 const CXCompletionContext_ObjCCategory = 65536;
1094 const CXCompletionContext_ObjCInstanceMessage = 131072;
1095 const CXCompletionContext_ObjCClassMessage = 262144;
1096 const CXCompletionContext_ObjCSelectorName = 524288;
1097 const CXCompletionContext_MacroName = 1048576;
1098 const CXCompletionContext_NaturalLanguage = 2097152;
1099 const CXCompletionContext_IncludedFile = 4194304;
1100 const CXCompletionContext_Unknown = 8388607;
1101 }
1102}
1103
1104cenum! {
1105 enum CXDiagnosticDisplayOptions {
1106 const CXDiagnostic_DisplaySourceLocation = 1;
1107 const CXDiagnostic_DisplayColumn = 2;
1108 const CXDiagnostic_DisplaySourceRanges = 4;
1109 const CXDiagnostic_DisplayOption = 8;
1110 const CXDiagnostic_DisplayCategoryId = 16;
1111 const CXDiagnostic_DisplayCategoryName = 32;
1112 }
1113}
1114
1115cenum! {
1116 enum CXGlobalOptFlags {
1117 const CXGlobalOpt_None = 0;
1118 const CXGlobalOpt_ThreadBackgroundPriorityForIndexing = 1;
1119 const CXGlobalOpt_ThreadBackgroundPriorityForEditing = 2;
1120 const CXGlobalOpt_ThreadBackgroundPriorityForAll = 3;
1121 }
1122}
1123
1124cenum! {
1125 enum CXIdxDeclInfoFlags {
1126 const CXIdxDeclFlag_Skipped = 1;
1127 }
1128}
1129
1130cenum! {
1131 enum CXIndexOptFlags {
1132 const CXIndexOptNone = 0;
1133 const CXIndexOptSuppressRedundantRefs = 1;
1134 const CXIndexOptIndexFunctionLocalSymbols = 2;
1135 const CXIndexOptIndexImplicitTemplateInstantiations = 4;
1136 const CXIndexOptSuppressWarnings = 8;
1137 const CXIndexOptSkipParsedBodiesInSession = 16;
1138 }
1139}
1140
1141cenum! {
1142 enum CXNameRefFlags {
1143 const CXNameRange_WantQualifier = 1;
1144 const CXNameRange_WantTemplateArgs = 2;
1145 const CXNameRange_WantSinglePiece = 4;
1146 }
1147}
1148
1149cenum! {
1150 enum CXObjCDeclQualifierKind {
1151 const CXObjCDeclQualifier_None = 0;
1152 const CXObjCDeclQualifier_In = 1;
1153 const CXObjCDeclQualifier_Inout = 2;
1154 const CXObjCDeclQualifier_Out = 4;
1155 const CXObjCDeclQualifier_Bycopy = 8;
1156 const CXObjCDeclQualifier_Byref = 16;
1157 const CXObjCDeclQualifier_Oneway = 32;
1158 }
1159}
1160
1161cenum! {
1162 enum CXObjCPropertyAttrKind {
1163 const CXObjCPropertyAttr_noattr = 0;
1164 const CXObjCPropertyAttr_readonly = 1;
1165 const CXObjCPropertyAttr_getter = 2;
1166 const CXObjCPropertyAttr_assign = 4;
1167 const CXObjCPropertyAttr_readwrite = 8;
1168 const CXObjCPropertyAttr_retain = 16;
1169 const CXObjCPropertyAttr_copy = 32;
1170 const CXObjCPropertyAttr_nonatomic = 64;
1171 const CXObjCPropertyAttr_setter = 128;
1172 const CXObjCPropertyAttr_atomic = 256;
1173 const CXObjCPropertyAttr_weak = 512;
1174 const CXObjCPropertyAttr_strong = 1024;
1175 const CXObjCPropertyAttr_unsafe_unretained = 2048;
1176 /// Only available on `libclang` 3.9 and later.
Haibo Huang8b9513e2020-07-13 22:05:39 -07001177 #[cfg(feature = "clang_3_9")]
Chih-Hung Hsiehfab43802020-04-07 14:24:01 -07001178 const CXObjCPropertyAttr_class = 4096;
1179 }
1180}
1181
1182cenum! {
1183 enum CXReparse_Flags {
1184 const CXReparse_None = 0;
1185 }
1186}
1187
1188cenum! {
1189 enum CXSaveTranslationUnit_Flags {
1190 const CXSaveTranslationUnit_None = 0;
1191 }
1192}
1193
1194cenum! {
1195 /// Only available on `libclang` 7.0 and later.
Haibo Huang8b9513e2020-07-13 22:05:39 -07001196 #[cfg(feature = "clang_7_0")]
Chih-Hung Hsiehfab43802020-04-07 14:24:01 -07001197 enum CXSymbolRole {
1198 const CXSymbolRole_None = 0;
1199 const CXSymbolRole_Declaration = 1;
1200 const CXSymbolRole_Definition = 2;
1201 const CXSymbolRole_Reference = 4;
1202 const CXSymbolRole_Read = 8;
1203 const CXSymbolRole_Write = 16;
1204 const CXSymbolRole_Call = 32;
1205 const CXSymbolRole_Dynamic = 64;
1206 const CXSymbolRole_AddressOf = 128;
1207 const CXSymbolRole_Implicit = 256;
1208 }
1209}
1210
1211cenum! {
1212 enum CXTranslationUnit_Flags {
1213 const CXTranslationUnit_None = 0;
1214 const CXTranslationUnit_DetailedPreprocessingRecord = 1;
1215 const CXTranslationUnit_Incomplete = 2;
1216 const CXTranslationUnit_PrecompiledPreamble = 4;
1217 const CXTranslationUnit_CacheCompletionResults = 8;
1218 const CXTranslationUnit_ForSerialization = 16;
1219 const CXTranslationUnit_CXXChainedPCH = 32;
1220 const CXTranslationUnit_SkipFunctionBodies = 64;
1221 const CXTranslationUnit_IncludeBriefCommentsInCodeCompletion = 128;
1222 /// Only available on `libclang` 3.8 and later.
Haibo Huang8b9513e2020-07-13 22:05:39 -07001223 #[cfg(feature = "clang_3_8")]
Chih-Hung Hsiehfab43802020-04-07 14:24:01 -07001224 const CXTranslationUnit_CreatePreambleOnFirstParse = 256;
1225 /// Only available on `libclang` 3.9 and later.
Haibo Huang8b9513e2020-07-13 22:05:39 -07001226 #[cfg(feature = "clang_3_9")]
Chih-Hung Hsiehfab43802020-04-07 14:24:01 -07001227 const CXTranslationUnit_KeepGoing = 512;
1228 /// Only available on `libclang` 5.0 and later.
Haibo Huang8b9513e2020-07-13 22:05:39 -07001229 #[cfg(feature = "clang_5_0")]
Chih-Hung Hsiehfab43802020-04-07 14:24:01 -07001230 const CXTranslationUnit_SingleFileParse = 1024;
1231 /// Only available on `libclang` 7.0 and later.
Haibo Huang8b9513e2020-07-13 22:05:39 -07001232 #[cfg(feature = "clang_7_0")]
Chih-Hung Hsiehfab43802020-04-07 14:24:01 -07001233 const CXTranslationUnit_LimitSkipFunctionBodiesToPreamble = 2048;
1234 /// Only available on `libclang` 8.0 and later.
Haibo Huang8b9513e2020-07-13 22:05:39 -07001235 #[cfg(feature = "clang_8_0")]
Chih-Hung Hsiehfab43802020-04-07 14:24:01 -07001236 const CXTranslationUnit_IncludeAttributedTypes = 4096;
1237 /// Only available on `libclang` 8.0 and later.
Haibo Huang8b9513e2020-07-13 22:05:39 -07001238 #[cfg(feature = "clang_8_0")]
Chih-Hung Hsiehfab43802020-04-07 14:24:01 -07001239 const CXTranslationUnit_VisitImplicitAttributes = 8192;
1240 /// Only available on `libclang` 9.0 and later.
Haibo Huang8b9513e2020-07-13 22:05:39 -07001241 #[cfg(feature = "clang_9_0")]
Chih-Hung Hsiehfab43802020-04-07 14:24:01 -07001242 const CXTranslationUnit_IgnoreNonErrorsFromIncludedFiles = 16384;
Haibo Huang8b9513e2020-07-13 22:05:39 -07001243 /// Only available on `libclang` 10.0 and later.
1244 #[cfg(feature = "clang_10_0")]
1245 const CXTranslationUnit_RetainExcludedConditionalBlocks = 32768;
Chih-Hung Hsiehfab43802020-04-07 14:24:01 -07001246 }
1247}
1248
1249//================================================
1250// Structs
1251//================================================
1252
1253// Opaque ________________________________________
1254
1255macro_rules! opaque {
1256 ($name:ident) => {
1257 pub type $name = *mut c_void;
1258 };
1259}
1260
1261opaque!(CXCompilationDatabase);
1262opaque!(CXCompileCommand);
1263opaque!(CXCompileCommands);
1264opaque!(CXCompletionString);
1265opaque!(CXCursorSet);
1266opaque!(CXDiagnostic);
1267opaque!(CXDiagnosticSet);
Haibo Huang8b9513e2020-07-13 22:05:39 -07001268#[cfg(feature = "clang_3_9")]
Chih-Hung Hsiehfab43802020-04-07 14:24:01 -07001269opaque!(CXEvalResult);
1270opaque!(CXFile);
1271opaque!(CXIdxClientASTFile);
1272opaque!(CXIdxClientContainer);
1273opaque!(CXIdxClientEntity);
1274opaque!(CXIdxClientFile);
1275opaque!(CXIndex);
1276opaque!(CXIndexAction);
1277opaque!(CXModule);
Haibo Huang8b9513e2020-07-13 22:05:39 -07001278#[cfg(feature = "clang_7_0")]
Chih-Hung Hsiehfab43802020-04-07 14:24:01 -07001279opaque!(CXPrintingPolicy);
1280opaque!(CXRemapping);
Haibo Huang8b9513e2020-07-13 22:05:39 -07001281#[cfg(feature = "clang_5_0")]
Chih-Hung Hsiehfab43802020-04-07 14:24:01 -07001282opaque!(CXTargetInfo);
1283opaque!(CXTranslationUnit);
1284
1285// Transparent ___________________________________
1286
1287#[derive(Copy, Clone, Debug)]
1288#[repr(C)]
1289pub struct CXCodeCompleteResults {
1290 pub Results: *mut CXCompletionResult,
1291 pub NumResults: c_uint,
1292}
1293
1294default!(CXCodeCompleteResults);
1295
1296#[derive(Copy, Clone, Debug)]
1297#[repr(C)]
1298pub struct CXComment {
1299 pub ASTNode: *const c_void,
1300 pub TranslationUnit: CXTranslationUnit,
1301}
1302
1303default!(CXComment);
1304
1305#[derive(Copy, Clone, Debug)]
1306#[repr(C)]
1307pub struct CXCompletionResult {
1308 pub CursorKind: CXCursorKind,
1309 pub CompletionString: CXCompletionString,
1310}
1311
1312default!(CXCompletionResult);
1313
1314#[derive(Copy, Clone, Debug)]
1315#[repr(C)]
1316pub struct CXCursor {
1317 pub kind: CXCursorKind,
1318 pub xdata: c_int,
1319 pub data: [*const c_void; 3],
1320}
1321
1322default!(CXCursor);
1323
1324#[derive(Copy, Clone, Debug)]
1325#[repr(C)]
1326pub struct CXCursorAndRangeVisitor {
1327 pub context: *mut c_void,
1328 pub visit: Option<extern "C" fn(*mut c_void, CXCursor, CXSourceRange) -> CXVisitorResult>,
1329}
1330
1331default!(CXCursorAndRangeVisitor);
1332
1333#[derive(Copy, Clone, Debug)]
1334#[repr(C)]
1335pub struct CXFileUniqueID {
1336 pub data: [c_ulonglong; 3],
1337}
1338
1339default!(CXFileUniqueID);
1340
1341#[derive(Copy, Clone, Debug)]
1342#[repr(C)]
1343pub struct CXIdxAttrInfo {
1344 pub kind: CXIdxAttrKind,
1345 pub cursor: CXCursor,
1346 pub loc: CXIdxLoc,
1347}
1348
1349default!(CXIdxAttrInfo);
1350
1351#[derive(Copy, Clone, Debug)]
1352#[repr(C)]
1353pub struct CXIdxBaseClassInfo {
1354 pub base: *const CXIdxEntityInfo,
1355 pub cursor: CXCursor,
1356 pub loc: CXIdxLoc,
1357}
1358
1359default!(CXIdxBaseClassInfo);
1360
1361#[derive(Copy, Clone, Debug)]
1362#[repr(C)]
1363pub struct CXIdxCXXClassDeclInfo {
1364 pub declInfo: *const CXIdxDeclInfo,
1365 pub bases: *const *const CXIdxBaseClassInfo,
1366 pub numBases: c_uint,
1367}
1368
1369default!(CXIdxCXXClassDeclInfo);
1370
1371#[derive(Copy, Clone, Debug)]
1372#[repr(C)]
1373pub struct CXIdxContainerInfo {
1374 pub cursor: CXCursor,
1375}
1376
1377default!(CXIdxContainerInfo);
1378
1379#[derive(Copy, Clone, Debug)]
1380#[repr(C)]
1381pub struct CXIdxDeclInfo {
1382 pub entityInfo: *const CXIdxEntityInfo,
1383 pub cursor: CXCursor,
1384 pub loc: CXIdxLoc,
1385 pub semanticContainer: *const CXIdxContainerInfo,
1386 pub lexicalContainer: *const CXIdxContainerInfo,
1387 pub isRedeclaration: c_int,
1388 pub isDefinition: c_int,
1389 pub isContainer: c_int,
1390 pub declAsContainer: *const CXIdxContainerInfo,
1391 pub isImplicit: c_int,
1392 pub attributes: *const *const CXIdxAttrInfo,
1393 pub numAttributes: c_uint,
1394 pub flags: c_uint,
1395}
1396
1397default!(CXIdxDeclInfo);
1398
1399#[derive(Copy, Clone, Debug)]
1400#[repr(C)]
1401pub struct CXIdxEntityInfo {
1402 pub kind: CXIdxEntityKind,
1403 pub templateKind: CXIdxEntityCXXTemplateKind,
1404 pub lang: CXIdxEntityLanguage,
1405 pub name: *const c_char,
1406 pub USR: *const c_char,
1407 pub cursor: CXCursor,
1408 pub attributes: *const *const CXIdxAttrInfo,
1409 pub numAttributes: c_uint,
1410}
1411
1412default!(CXIdxEntityInfo);
1413
1414#[derive(Copy, Clone, Debug)]
1415#[repr(C)]
1416pub struct CXIdxEntityRefInfo {
1417 pub kind: CXIdxEntityRefKind,
1418 pub cursor: CXCursor,
1419 pub loc: CXIdxLoc,
1420 pub referencedEntity: *const CXIdxEntityInfo,
1421 pub parentEntity: *const CXIdxEntityInfo,
1422 pub container: *const CXIdxContainerInfo,
1423 /// Only available on `libclang` 7.0 and later.
Haibo Huang8b9513e2020-07-13 22:05:39 -07001424 #[cfg(feature = "clang_7_0")]
Chih-Hung Hsiehfab43802020-04-07 14:24:01 -07001425 pub role: CXSymbolRole,
1426}
1427
1428default!(CXIdxEntityRefInfo);
1429
1430#[derive(Copy, Clone, Debug)]
1431#[repr(C)]
1432pub struct CXIdxIBOutletCollectionAttrInfo {
1433 pub attrInfo: *const CXIdxAttrInfo,
1434 pub objcClass: *const CXIdxEntityInfo,
1435 pub classCursor: CXCursor,
1436 pub classLoc: CXIdxLoc,
1437}
1438
1439default!(CXIdxIBOutletCollectionAttrInfo);
1440
1441#[derive(Copy, Clone, Debug)]
1442#[repr(C)]
1443pub struct CXIdxImportedASTFileInfo {
1444 pub file: CXFile,
1445 pub module: CXModule,
1446 pub loc: CXIdxLoc,
1447 pub isImplicit: c_int,
1448}
1449
1450default!(CXIdxImportedASTFileInfo);
1451
1452#[derive(Copy, Clone, Debug)]
1453#[repr(C)]
1454pub struct CXIdxIncludedFileInfo {
1455 pub hashLoc: CXIdxLoc,
1456 pub filename: *const c_char,
1457 pub file: CXFile,
1458 pub isImport: c_int,
1459 pub isAngled: c_int,
1460 pub isModuleImport: c_int,
1461}
1462
1463default!(CXIdxIncludedFileInfo);
1464
1465#[derive(Copy, Clone, Debug)]
1466#[repr(C)]
1467pub struct CXIdxLoc {
1468 pub ptr_data: [*mut c_void; 2],
1469 pub int_data: c_uint,
1470}
1471
1472default!(CXIdxLoc);
1473
1474#[derive(Copy, Clone, Debug)]
1475#[repr(C)]
1476pub struct CXIdxObjCCategoryDeclInfo {
1477 pub containerInfo: *const CXIdxObjCContainerDeclInfo,
1478 pub objcClass: *const CXIdxEntityInfo,
1479 pub classCursor: CXCursor,
1480 pub classLoc: CXIdxLoc,
1481 pub protocols: *const CXIdxObjCProtocolRefListInfo,
1482}
1483
1484default!(CXIdxObjCCategoryDeclInfo);
1485
1486#[derive(Copy, Clone, Debug)]
1487#[repr(C)]
1488pub struct CXIdxObjCContainerDeclInfo {
1489 pub declInfo: *const CXIdxDeclInfo,
1490 pub kind: CXIdxObjCContainerKind,
1491}
1492
1493default!(CXIdxObjCContainerDeclInfo);
1494
1495#[derive(Copy, Clone, Debug)]
1496#[repr(C)]
1497pub struct CXIdxObjCInterfaceDeclInfo {
1498 pub containerInfo: *const CXIdxObjCContainerDeclInfo,
1499 pub superInfo: *const CXIdxBaseClassInfo,
1500 pub protocols: *const CXIdxObjCProtocolRefListInfo,
1501}
1502
1503default!(CXIdxObjCInterfaceDeclInfo);
1504
1505#[derive(Copy, Clone, Debug)]
1506#[repr(C)]
1507pub struct CXIdxObjCPropertyDeclInfo {
1508 pub declInfo: *const CXIdxDeclInfo,
1509 pub getter: *const CXIdxEntityInfo,
1510 pub setter: *const CXIdxEntityInfo,
1511}
1512
1513default!(CXIdxObjCPropertyDeclInfo);
1514
1515#[derive(Copy, Clone, Debug)]
1516#[repr(C)]
1517pub struct CXIdxObjCProtocolRefInfo {
1518 pub protocol: *const CXIdxEntityInfo,
1519 pub cursor: CXCursor,
1520 pub loc: CXIdxLoc,
1521}
1522
1523default!(CXIdxObjCProtocolRefInfo);
1524
1525#[derive(Copy, Clone, Debug)]
1526#[repr(C)]
1527pub struct CXIdxObjCProtocolRefListInfo {
1528 pub protocols: *const *const CXIdxObjCProtocolRefInfo,
1529 pub numProtocols: c_uint,
1530}
1531
1532default!(CXIdxObjCProtocolRefListInfo);
1533
1534#[derive(Copy, Clone, Debug)]
1535#[repr(C)]
1536pub struct CXPlatformAvailability {
1537 pub Platform: CXString,
1538 pub Introduced: CXVersion,
1539 pub Deprecated: CXVersion,
1540 pub Obsoleted: CXVersion,
1541 pub Unavailable: c_int,
1542 pub Message: CXString,
1543}
1544
1545default!(CXPlatformAvailability);
1546
1547#[derive(Copy, Clone, Debug)]
1548#[repr(C)]
1549pub struct CXSourceLocation {
1550 pub ptr_data: [*const c_void; 2],
1551 pub int_data: c_uint,
1552}
1553
1554default!(CXSourceLocation);
1555
1556#[derive(Copy, Clone, Debug)]
1557#[repr(C)]
1558pub struct CXSourceRange {
1559 pub ptr_data: [*const c_void; 2],
1560 pub begin_int_data: c_uint,
1561 pub end_int_data: c_uint,
1562}
1563
1564default!(CXSourceRange);
1565
1566#[derive(Copy, Clone, Debug)]
1567#[repr(C)]
1568pub struct CXSourceRangeList {
1569 pub count: c_uint,
1570 pub ranges: *mut CXSourceRange,
1571}
1572
1573default!(CXSourceRangeList);
1574
1575#[derive(Copy, Clone, Debug)]
1576#[repr(C)]
1577pub struct CXString {
1578 pub data: *const c_void,
1579 pub private_flags: c_uint,
1580}
1581
1582default!(CXString);
1583
Haibo Huang8b9513e2020-07-13 22:05:39 -07001584#[cfg(feature = "clang_3_8")]
Chih-Hung Hsiehfab43802020-04-07 14:24:01 -07001585#[derive(Copy, Clone, Debug)]
1586#[repr(C)]
1587pub struct CXStringSet {
1588 pub Strings: *mut CXString,
1589 pub Count: c_uint,
1590}
1591
Haibo Huang8b9513e2020-07-13 22:05:39 -07001592#[cfg(feature = "clang_3_8")]
Chih-Hung Hsiehfab43802020-04-07 14:24:01 -07001593default!(CXStringSet);
1594
1595#[derive(Copy, Clone, Debug)]
1596#[repr(C)]
1597pub struct CXTUResourceUsage {
1598 pub data: *mut c_void,
1599 pub numEntries: c_uint,
1600 pub entries: *mut CXTUResourceUsageEntry,
1601}
1602
1603default!(CXTUResourceUsage);
1604
1605#[derive(Copy, Clone, Debug)]
1606#[repr(C)]
1607pub struct CXTUResourceUsageEntry {
1608 pub kind: CXTUResourceUsageKind,
1609 pub amount: c_ulong,
1610}
1611
1612default!(CXTUResourceUsageEntry);
1613
1614#[derive(Copy, Clone, Debug)]
1615#[repr(C)]
1616pub struct CXToken {
1617 pub int_data: [c_uint; 4],
1618 pub ptr_data: *mut c_void,
1619}
1620
1621default!(CXToken);
1622
1623#[derive(Copy, Clone, Debug)]
1624#[repr(C)]
1625pub struct CXType {
1626 pub kind: CXTypeKind,
1627 pub data: [*mut c_void; 2],
1628}
1629
1630default!(CXType);
1631
1632#[derive(Copy, Clone, Debug)]
1633#[repr(C)]
1634pub struct CXUnsavedFile {
1635 pub Filename: *const c_char,
1636 pub Contents: *const c_char,
1637 pub Length: c_ulong,
1638}
1639
1640default!(CXUnsavedFile);
1641
1642#[derive(Copy, Clone, Debug)]
1643#[repr(C)]
1644pub struct CXVersion {
1645 pub Major: c_int,
1646 pub Minor: c_int,
1647 pub Subminor: c_int,
1648}
1649
1650default!(CXVersion);
1651
1652#[derive(Copy, Clone, Debug)]
1653#[repr(C)]
1654#[rustfmt::skip]
1655pub struct IndexerCallbacks {
1656 pub abortQuery: Option<extern "C" fn(CXClientData, *mut c_void) -> c_int>,
1657 pub diagnostic: Option<extern "C" fn(CXClientData, CXDiagnosticSet, *mut c_void)>,
1658 pub enteredMainFile: Option<extern "C" fn(CXClientData, CXFile, *mut c_void) -> CXIdxClientFile>,
1659 pub ppIncludedFile: Option<extern "C" fn(CXClientData, *const CXIdxIncludedFileInfo) -> CXIdxClientFile>,
1660 pub importedASTFile: Option<extern "C" fn(CXClientData, *const CXIdxImportedASTFileInfo) -> CXIdxClientASTFile>,
1661 pub startedTranslationUnit: Option<extern "C" fn(CXClientData, *mut c_void) -> CXIdxClientContainer>,
1662 pub indexDeclaration: Option<extern "C" fn(CXClientData, *const CXIdxDeclInfo)>,
1663 pub indexEntityReference: Option<extern "C" fn(CXClientData, *const CXIdxEntityRefInfo)>,
1664}
1665
1666default!(IndexerCallbacks);
1667
1668//================================================
1669// Functions
1670//================================================
1671
1672link! {
1673 pub fn clang_CXCursorSet_contains(set: CXCursorSet, cursor: CXCursor) -> c_uint;
1674 pub fn clang_CXCursorSet_insert(set: CXCursorSet, cursor: CXCursor) -> c_uint;
1675 pub fn clang_CXIndex_getGlobalOptions(index: CXIndex) -> CXGlobalOptFlags;
1676 pub fn clang_CXIndex_setGlobalOptions(index: CXIndex, flags: CXGlobalOptFlags);
1677 /// Only available on `libclang` 6.0 and later.
Haibo Huang8b9513e2020-07-13 22:05:39 -07001678 #[cfg(feature = "clang_6_0")]
Chih-Hung Hsiehfab43802020-04-07 14:24:01 -07001679 pub fn clang_CXIndex_setInvocationEmissionPathOption(index: CXIndex, path: *const c_char);
1680 /// Only available on `libclang` 3.9 and later.
Haibo Huang8b9513e2020-07-13 22:05:39 -07001681 #[cfg(feature = "clang_3_9")]
Chih-Hung Hsiehfab43802020-04-07 14:24:01 -07001682 pub fn clang_CXXConstructor_isConvertingConstructor(cursor: CXCursor) -> c_uint;
1683 /// Only available on `libclang` 3.9 and later.
Haibo Huang8b9513e2020-07-13 22:05:39 -07001684 #[cfg(feature = "clang_3_9")]
Chih-Hung Hsiehfab43802020-04-07 14:24:01 -07001685 pub fn clang_CXXConstructor_isCopyConstructor(cursor: CXCursor) -> c_uint;
1686 /// Only available on `libclang` 3.9 and later.
Haibo Huang8b9513e2020-07-13 22:05:39 -07001687 #[cfg(feature = "clang_3_9")]
Chih-Hung Hsiehfab43802020-04-07 14:24:01 -07001688 pub fn clang_CXXConstructor_isDefaultConstructor(cursor: CXCursor) -> c_uint;
1689 /// Only available on `libclang` 3.9 and later.
Haibo Huang8b9513e2020-07-13 22:05:39 -07001690 #[cfg(feature = "clang_3_9")]
Chih-Hung Hsiehfab43802020-04-07 14:24:01 -07001691 pub fn clang_CXXConstructor_isMoveConstructor(cursor: CXCursor) -> c_uint;
1692 /// Only available on `libclang` 3.8 and later.
Haibo Huang8b9513e2020-07-13 22:05:39 -07001693 #[cfg(feature = "clang_3_8")]
Chih-Hung Hsiehfab43802020-04-07 14:24:01 -07001694 pub fn clang_CXXField_isMutable(cursor: CXCursor) -> c_uint;
1695 pub fn clang_CXXMethod_isConst(cursor: CXCursor) -> c_uint;
1696 /// Only available on `libclang` 3.9 and later.
Haibo Huang8b9513e2020-07-13 22:05:39 -07001697 #[cfg(feature = "clang_3_9")]
Chih-Hung Hsiehfab43802020-04-07 14:24:01 -07001698 pub fn clang_CXXMethod_isDefaulted(cursor: CXCursor) -> c_uint;
1699 pub fn clang_CXXMethod_isPureVirtual(cursor: CXCursor) -> c_uint;
1700 pub fn clang_CXXMethod_isStatic(cursor: CXCursor) -> c_uint;
1701 pub fn clang_CXXMethod_isVirtual(cursor: CXCursor) -> c_uint;
1702 /// Only available on `libclang` 6.0 and later.
Haibo Huang8b9513e2020-07-13 22:05:39 -07001703 #[cfg(feature = "clang_6_0")]
Chih-Hung Hsiehfab43802020-04-07 14:24:01 -07001704 pub fn clang_CXXRecord_isAbstract(cursor: CXCursor) -> c_uint;
1705 pub fn clang_CompilationDatabase_dispose(database: CXCompilationDatabase);
1706 pub fn clang_CompilationDatabase_fromDirectory(directory: *const c_char, error: *mut CXCompilationDatabase_Error) -> CXCompilationDatabase;
1707 pub fn clang_CompilationDatabase_getAllCompileCommands(database: CXCompilationDatabase) -> CXCompileCommands;
1708 pub fn clang_CompilationDatabase_getCompileCommands(database: CXCompilationDatabase, filename: *const c_char) -> CXCompileCommands;
1709 pub fn clang_CompileCommand_getArg(command: CXCompileCommand, index: c_uint) -> CXString;
1710 pub fn clang_CompileCommand_getDirectory(command: CXCompileCommand) -> CXString;
1711 /// Only available on `libclang` 3.8 and later.
Haibo Huang8b9513e2020-07-13 22:05:39 -07001712 #[cfg(feature = "clang_3_8")]
Chih-Hung Hsiehfab43802020-04-07 14:24:01 -07001713 pub fn clang_CompileCommand_getFilename(command: CXCompileCommand) -> CXString;
1714 /// Only available on `libclang` 3.8 and later.
Haibo Huang8b9513e2020-07-13 22:05:39 -07001715 #[cfg(feature = "clang_3_8")]
Chih-Hung Hsiehfab43802020-04-07 14:24:01 -07001716 pub fn clang_CompileCommand_getMappedSourceContent(command: CXCompileCommand, index: c_uint) -> CXString;
1717 /// Only available on `libclang` 3.8 and later.
Haibo Huang8b9513e2020-07-13 22:05:39 -07001718 #[cfg(feature = "clang_3_8")]
Chih-Hung Hsiehfab43802020-04-07 14:24:01 -07001719 pub fn clang_CompileCommand_getMappedSourcePath(command: CXCompileCommand, index: c_uint) -> CXString;
1720 pub fn clang_CompileCommand_getNumArgs(command: CXCompileCommand) -> c_uint;
1721 pub fn clang_CompileCommand_getNumMappedSources(command: CXCompileCommand) -> c_uint;
1722 pub fn clang_CompileCommands_dispose(command: CXCompileCommands);
1723 pub fn clang_CompileCommands_getCommand(command: CXCompileCommands, index: c_uint) -> CXCompileCommand;
1724 pub fn clang_CompileCommands_getSize(command: CXCompileCommands) -> c_uint;
1725 /// Only available on `libclang` 3.9 and later.
Haibo Huang8b9513e2020-07-13 22:05:39 -07001726 #[cfg(feature = "clang_3_9")]
Chih-Hung Hsiehfab43802020-04-07 14:24:01 -07001727 pub fn clang_Cursor_Evaluate(cursor: CXCursor) -> CXEvalResult;
1728 pub fn clang_Cursor_getArgument(cursor: CXCursor, index: c_uint) -> CXCursor;
1729 pub fn clang_Cursor_getBriefCommentText(cursor: CXCursor) -> CXString;
1730 /// Only available on `libclang` 3.8 and later.
Haibo Huang8b9513e2020-07-13 22:05:39 -07001731 #[cfg(feature = "clang_3_8")]
Chih-Hung Hsiehfab43802020-04-07 14:24:01 -07001732 pub fn clang_Cursor_getCXXManglings(cursor: CXCursor) -> *mut CXStringSet;
1733 pub fn clang_Cursor_getCommentRange(cursor: CXCursor) -> CXSourceRange;
1734 /// Only available on `libclang` 3.6 and later.
Haibo Huang8b9513e2020-07-13 22:05:39 -07001735 #[cfg(feature = "clang_3_6")]
Chih-Hung Hsiehfab43802020-04-07 14:24:01 -07001736 pub fn clang_Cursor_getMangling(cursor: CXCursor) -> CXString;
1737 pub fn clang_Cursor_getModule(cursor: CXCursor) -> CXModule;
1738 pub fn clang_Cursor_getNumArguments(cursor: CXCursor) -> c_int;
1739 /// Only available on `libclang` 3.6 and later.
Haibo Huang8b9513e2020-07-13 22:05:39 -07001740 #[cfg(feature = "clang_3_6")]
Chih-Hung Hsiehfab43802020-04-07 14:24:01 -07001741 pub fn clang_Cursor_getNumTemplateArguments(cursor: CXCursor) -> c_int;
1742 pub fn clang_Cursor_getObjCDeclQualifiers(cursor: CXCursor) -> CXObjCDeclQualifierKind;
1743 /// Only available on `libclang` 6.0 and later.
Haibo Huang8b9513e2020-07-13 22:05:39 -07001744 #[cfg(feature = "clang_6_0")]
Chih-Hung Hsiehfab43802020-04-07 14:24:01 -07001745 pub fn clang_Cursor_getObjCManglings(cursor: CXCursor) -> *mut CXStringSet;
1746 pub fn clang_Cursor_getObjCPropertyAttributes(cursor: CXCursor, reserved: c_uint) -> CXObjCPropertyAttrKind;
1747 /// Only available on `libclang` 8.0 and later.
Haibo Huang8b9513e2020-07-13 22:05:39 -07001748 #[cfg(feature = "clang_8_0")]
Chih-Hung Hsiehfab43802020-04-07 14:24:01 -07001749 pub fn clang_Cursor_getObjCPropertyGetterName(cursor: CXCursor) -> CXString;
1750 /// Only available on `libclang` 8.0 and later.
Haibo Huang8b9513e2020-07-13 22:05:39 -07001751 #[cfg(feature = "clang_8_0")]
Chih-Hung Hsiehfab43802020-04-07 14:24:01 -07001752 pub fn clang_Cursor_getObjCPropertySetterName(cursor: CXCursor) -> CXString;
1753 pub fn clang_Cursor_getObjCSelectorIndex(cursor: CXCursor) -> c_int;
1754 /// Only available on `libclang` 3.7 and later.
Haibo Huang8b9513e2020-07-13 22:05:39 -07001755 #[cfg(feature = "clang_3_7")]
Chih-Hung Hsiehfab43802020-04-07 14:24:01 -07001756 pub fn clang_Cursor_getOffsetOfField(cursor: CXCursor) -> c_longlong;
1757 /// Only available on `libclang` 9.0 and later.
Haibo Huang8b9513e2020-07-13 22:05:39 -07001758 #[cfg(feature = "clang_9_0")]
Chih-Hung Hsiehfab43802020-04-07 14:24:01 -07001759 pub fn clang_Cursor_isAnonymousRecordDecl(cursor: CXCursor) -> c_uint;
1760 /// Only available on `libclang` 9.0 and later.
Haibo Huang8b9513e2020-07-13 22:05:39 -07001761 #[cfg(feature = "clang_9_0")]
Chih-Hung Hsiehfab43802020-04-07 14:24:01 -07001762 pub fn clang_Cursor_isInlineNamespace(cursor: CXCursor) -> c_uint;
1763 pub fn clang_Cursor_getRawCommentText(cursor: CXCursor) -> CXString;
1764 pub fn clang_Cursor_getReceiverType(cursor: CXCursor) -> CXType;
1765 pub fn clang_Cursor_getSpellingNameRange(cursor: CXCursor, index: c_uint, reserved: c_uint) -> CXSourceRange;
1766 /// Only available on `libclang` 3.6 and later.
Haibo Huang8b9513e2020-07-13 22:05:39 -07001767 #[cfg(feature = "clang_3_6")]
Chih-Hung Hsiehfab43802020-04-07 14:24:01 -07001768 pub fn clang_Cursor_getStorageClass(cursor: CXCursor) -> CX_StorageClass;
1769 /// Only available on `libclang` 3.6 and later.
Haibo Huang8b9513e2020-07-13 22:05:39 -07001770 #[cfg(feature = "clang_3_6")]
Chih-Hung Hsiehfab43802020-04-07 14:24:01 -07001771 pub fn clang_Cursor_getTemplateArgumentKind(cursor: CXCursor, index: c_uint) -> CXTemplateArgumentKind;
1772 /// Only available on `libclang` 3.6 and later.
Haibo Huang8b9513e2020-07-13 22:05:39 -07001773 #[cfg(feature = "clang_3_6")]
Chih-Hung Hsiehfab43802020-04-07 14:24:01 -07001774 pub fn clang_Cursor_getTemplateArgumentType(cursor: CXCursor, index: c_uint) -> CXType;
1775 /// Only available on `libclang` 3.6 and later.
Haibo Huang8b9513e2020-07-13 22:05:39 -07001776 #[cfg(feature = "clang_3_6")]
Chih-Hung Hsiehfab43802020-04-07 14:24:01 -07001777 pub fn clang_Cursor_getTemplateArgumentUnsignedValue(cursor: CXCursor, index: c_uint) -> c_ulonglong;
1778 /// Only available on `libclang` 3.6 and later.
Haibo Huang8b9513e2020-07-13 22:05:39 -07001779 #[cfg(feature = "clang_3_6")]
Chih-Hung Hsiehfab43802020-04-07 14:24:01 -07001780 pub fn clang_Cursor_getTemplateArgumentValue(cursor: CXCursor, index: c_uint) -> c_longlong;
1781 pub fn clang_Cursor_getTranslationUnit(cursor: CXCursor) -> CXTranslationUnit;
1782 /// Only available on `libclang` 3.9 and later.
Haibo Huang8b9513e2020-07-13 22:05:39 -07001783 #[cfg(feature = "clang_3_9")]
Chih-Hung Hsiehfab43802020-04-07 14:24:01 -07001784 pub fn clang_Cursor_hasAttrs(cursor: CXCursor) -> c_uint;
1785 /// Only available on `libclang` 3.7 and later.
Haibo Huang8b9513e2020-07-13 22:05:39 -07001786 #[cfg(feature = "clang_3_7")]
Chih-Hung Hsiehfab43802020-04-07 14:24:01 -07001787 pub fn clang_Cursor_isAnonymous(cursor: CXCursor) -> c_uint;
1788 pub fn clang_Cursor_isBitField(cursor: CXCursor) -> c_uint;
1789 pub fn clang_Cursor_isDynamicCall(cursor: CXCursor) -> c_int;
1790 /// Only available on `libclang` 5.0 and later.
Haibo Huang8b9513e2020-07-13 22:05:39 -07001791 #[cfg(feature = "clang_5_0")]
Chih-Hung Hsiehfab43802020-04-07 14:24:01 -07001792 pub fn clang_Cursor_isExternalSymbol(cursor: CXCursor, language: *mut CXString, from: *mut CXString, generated: *mut c_uint) -> c_uint;
1793 /// Only available on `libclang` 3.9 and later.
Haibo Huang8b9513e2020-07-13 22:05:39 -07001794 #[cfg(feature = "clang_3_9")]
Chih-Hung Hsiehfab43802020-04-07 14:24:01 -07001795 pub fn clang_Cursor_isFunctionInlined(cursor: CXCursor) -> c_uint;
1796 /// Only available on `libclang` 3.9 and later.
Haibo Huang8b9513e2020-07-13 22:05:39 -07001797 #[cfg(feature = "clang_3_9")]
Chih-Hung Hsiehfab43802020-04-07 14:24:01 -07001798 pub fn clang_Cursor_isMacroBuiltin(cursor: CXCursor) -> c_uint;
1799 /// Only available on `libclang` 3.9 and later.
Haibo Huang8b9513e2020-07-13 22:05:39 -07001800 #[cfg(feature = "clang_3_9")]
Chih-Hung Hsiehfab43802020-04-07 14:24:01 -07001801 pub fn clang_Cursor_isMacroFunctionLike(cursor: CXCursor) -> c_uint;
1802 pub fn clang_Cursor_isNull(cursor: CXCursor) -> c_int;
1803 pub fn clang_Cursor_isObjCOptional(cursor: CXCursor) -> c_uint;
1804 pub fn clang_Cursor_isVariadic(cursor: CXCursor) -> c_uint;
1805 /// Only available on `libclang` 5.0 and later.
Haibo Huang8b9513e2020-07-13 22:05:39 -07001806 #[cfg(feature = "clang_5_0")]
Chih-Hung Hsiehfab43802020-04-07 14:24:01 -07001807 pub fn clang_EnumDecl_isScoped(cursor: CXCursor) -> c_uint;
1808 /// Only available on `libclang` 3.9 and later.
Haibo Huang8b9513e2020-07-13 22:05:39 -07001809 #[cfg(feature = "clang_3_9")]
Chih-Hung Hsiehfab43802020-04-07 14:24:01 -07001810 pub fn clang_EvalResult_dispose(result: CXEvalResult);
1811 /// Only available on `libclang` 3.9 and later.
Haibo Huang8b9513e2020-07-13 22:05:39 -07001812 #[cfg(feature = "clang_3_9")]
Chih-Hung Hsiehfab43802020-04-07 14:24:01 -07001813 pub fn clang_EvalResult_getAsDouble(result: CXEvalResult) -> libc::c_double;
1814 /// Only available on `libclang` 3.9 and later.
Haibo Huang8b9513e2020-07-13 22:05:39 -07001815 #[cfg(feature = "clang_3_9")]
Chih-Hung Hsiehfab43802020-04-07 14:24:01 -07001816 pub fn clang_EvalResult_getAsInt(result: CXEvalResult) -> c_int;
1817 /// Only available on `libclang` 4.0 and later.
Haibo Huang8b9513e2020-07-13 22:05:39 -07001818 #[cfg(feature = "clang_4_0")]
Chih-Hung Hsiehfab43802020-04-07 14:24:01 -07001819 pub fn clang_EvalResult_getAsLongLong(result: CXEvalResult) -> c_longlong;
1820 /// Only available on `libclang` 3.9 and later.
Haibo Huang8b9513e2020-07-13 22:05:39 -07001821 #[cfg(feature = "clang_3_9")]
Chih-Hung Hsiehfab43802020-04-07 14:24:01 -07001822 pub fn clang_EvalResult_getAsStr(result: CXEvalResult) -> *const c_char;
1823 /// Only available on `libclang` 4.0 and later.
Haibo Huang8b9513e2020-07-13 22:05:39 -07001824 #[cfg(feature = "clang_4_0")]
Chih-Hung Hsiehfab43802020-04-07 14:24:01 -07001825 pub fn clang_EvalResult_getAsUnsigned(result: CXEvalResult) -> c_ulonglong;
1826 /// Only available on `libclang` 3.9 and later.
Haibo Huang8b9513e2020-07-13 22:05:39 -07001827 #[cfg(feature = "clang_3_9")]
Chih-Hung Hsiehfab43802020-04-07 14:24:01 -07001828 pub fn clang_EvalResult_getKind(result: CXEvalResult) -> CXEvalResultKind;
1829 /// Only available on `libclang` 4.0 and later.
Haibo Huang8b9513e2020-07-13 22:05:39 -07001830 #[cfg(feature = "clang_4_0")]
Chih-Hung Hsiehfab43802020-04-07 14:24:01 -07001831 pub fn clang_EvalResult_isUnsignedInt(result: CXEvalResult) -> c_uint;
1832 /// Only available on `libclang` 3.6 and later.
Haibo Huang8b9513e2020-07-13 22:05:39 -07001833 #[cfg(feature = "clang_3_6")]
Chih-Hung Hsiehfab43802020-04-07 14:24:01 -07001834 pub fn clang_File_isEqual(left: CXFile, right: CXFile) -> c_int;
1835 /// Only available on `libclang` 7.0 and later.
Haibo Huang8b9513e2020-07-13 22:05:39 -07001836 #[cfg(feature = "clang_7_0")]
Chih-Hung Hsiehfab43802020-04-07 14:24:01 -07001837 pub fn clang_File_tryGetRealPathName(file: CXFile) -> CXString;
1838 pub fn clang_IndexAction_create(index: CXIndex) -> CXIndexAction;
1839 pub fn clang_IndexAction_dispose(index: CXIndexAction);
1840 pub fn clang_Location_isFromMainFile(location: CXSourceLocation) -> c_int;
1841 pub fn clang_Location_isInSystemHeader(location: CXSourceLocation) -> c_int;
1842 pub fn clang_Module_getASTFile(module: CXModule) -> CXFile;
1843 pub fn clang_Module_getFullName(module: CXModule) -> CXString;
1844 pub fn clang_Module_getName(module: CXModule) -> CXString;
1845 pub fn clang_Module_getNumTopLevelHeaders(tu: CXTranslationUnit, module: CXModule) -> c_uint;
1846 pub fn clang_Module_getParent(module: CXModule) -> CXModule;
1847 pub fn clang_Module_getTopLevelHeader(tu: CXTranslationUnit, module: CXModule, index: c_uint) -> CXFile;
1848 pub fn clang_Module_isSystem(module: CXModule) -> c_int;
1849 /// Only available on `libclang` 7.0 and later.
Haibo Huang8b9513e2020-07-13 22:05:39 -07001850 #[cfg(feature = "clang_7_0")]
Chih-Hung Hsiehfab43802020-04-07 14:24:01 -07001851 pub fn clang_PrintingPolicy_dispose(policy: CXPrintingPolicy);
1852 /// Only available on `libclang` 7.0 and later.
Haibo Huang8b9513e2020-07-13 22:05:39 -07001853 #[cfg(feature = "clang_7_0")]
Chih-Hung Hsiehfab43802020-04-07 14:24:01 -07001854 pub fn clang_PrintingPolicy_getProperty(policy: CXPrintingPolicy, property: CXPrintingPolicyProperty) -> c_uint;
1855 /// Only available on `libclang` 7.0 and later.
Haibo Huang8b9513e2020-07-13 22:05:39 -07001856 #[cfg(feature = "clang_7_0")]
Chih-Hung Hsiehfab43802020-04-07 14:24:01 -07001857 pub fn clang_PrintingPolicy_setProperty(policy: CXPrintingPolicy, property: CXPrintingPolicyProperty, value: c_uint);
1858 pub fn clang_Range_isNull(range: CXSourceRange) -> c_int;
1859 /// Only available on `libclang` 5.0 and later.
Haibo Huang8b9513e2020-07-13 22:05:39 -07001860 #[cfg(feature = "clang_5_0")]
Chih-Hung Hsiehfab43802020-04-07 14:24:01 -07001861 pub fn clang_TargetInfo_dispose(info: CXTargetInfo);
1862 /// Only available on `libclang` 5.0 and later.
Haibo Huang8b9513e2020-07-13 22:05:39 -07001863 #[cfg(feature = "clang_5_0")]
Chih-Hung Hsiehfab43802020-04-07 14:24:01 -07001864 pub fn clang_TargetInfo_getPointerWidth(info: CXTargetInfo) -> c_int;
1865 /// Only available on `libclang` 5.0 and later.
Haibo Huang8b9513e2020-07-13 22:05:39 -07001866 #[cfg(feature = "clang_5_0")]
Chih-Hung Hsiehfab43802020-04-07 14:24:01 -07001867 pub fn clang_TargetInfo_getTriple(info: CXTargetInfo) -> CXString;
1868 pub fn clang_Type_getAlignOf(type_: CXType) -> c_longlong;
1869 pub fn clang_Type_getCXXRefQualifier(type_: CXType) -> CXRefQualifierKind;
1870 pub fn clang_Type_getClassType(type_: CXType) -> CXType;
1871 /// Only available on `libclang` 3.9 and later.
Haibo Huang8b9513e2020-07-13 22:05:39 -07001872 #[cfg(feature = "clang_3_9")]
Chih-Hung Hsiehfab43802020-04-07 14:24:01 -07001873 pub fn clang_Type_getNamedType(type_: CXType) -> CXType;
1874 pub fn clang_Type_getNumTemplateArguments(type_: CXType) -> c_int;
1875 /// Only available on `libclang` 8.0 and later.
Haibo Huang8b9513e2020-07-13 22:05:39 -07001876 #[cfg(feature = "clang_8_0")]
Chih-Hung Hsiehfab43802020-04-07 14:24:01 -07001877 pub fn clang_Type_getObjCObjectBaseType(type_: CXType) -> CXType;
1878 /// Only available on `libclang` 8.0 and later.
Haibo Huang8b9513e2020-07-13 22:05:39 -07001879 #[cfg(feature = "clang_8_0")]
Chih-Hung Hsiehfab43802020-04-07 14:24:01 -07001880 pub fn clang_Type_getNumObjCProtocolRefs(type_: CXType) -> c_uint;
1881 /// Only available on `libclang` 8.0 and later.
Haibo Huang8b9513e2020-07-13 22:05:39 -07001882 #[cfg(feature = "clang_8_0")]
Chih-Hung Hsiehfab43802020-04-07 14:24:01 -07001883 pub fn clang_Type_getObjCProtocolDecl(type_: CXType, index: c_uint) -> CXCursor;
1884 /// Only available on `libclang` 8.0 and later.
Haibo Huang8b9513e2020-07-13 22:05:39 -07001885 #[cfg(feature = "clang_8_0")]
Chih-Hung Hsiehfab43802020-04-07 14:24:01 -07001886 pub fn clang_Type_getNumObjCTypeArgs(type_: CXType) -> c_uint;
1887 /// Only available on `libclang` 8.0 and later.
Haibo Huang8b9513e2020-07-13 22:05:39 -07001888 #[cfg(feature = "clang_8_0")]
Chih-Hung Hsiehfab43802020-04-07 14:24:01 -07001889 pub fn clang_Type_getObjCTypeArg(type_: CXType, index: c_uint) -> CXType;
1890 /// Only available on `libclang` 3.9 and later.
Haibo Huang8b9513e2020-07-13 22:05:39 -07001891 #[cfg(feature = "clang_3_9")]
Chih-Hung Hsiehfab43802020-04-07 14:24:01 -07001892 pub fn clang_Type_getObjCEncoding(type_: CXType) -> CXString;
1893 pub fn clang_Type_getOffsetOf(type_: CXType, field: *const c_char) -> c_longlong;
1894 /// Only available on `libclang` 8.0 and later.
Haibo Huang8b9513e2020-07-13 22:05:39 -07001895 #[cfg(feature = "clang_8_0")]
Chih-Hung Hsiehfab43802020-04-07 14:24:01 -07001896 pub fn clang_Type_getModifiedType(type_: CXType) -> CXType;
1897 pub fn clang_Type_getSizeOf(type_: CXType) -> c_longlong;
1898 pub fn clang_Type_getTemplateArgumentAsType(type_: CXType, index: c_uint) -> CXType;
1899 /// Only available on `libclang` 5.0 and later.
Haibo Huang8b9513e2020-07-13 22:05:39 -07001900 #[cfg(feature = "clang_5_0")]
Chih-Hung Hsiehfab43802020-04-07 14:24:01 -07001901 pub fn clang_Type_isTransparentTagTypedef(type_: CXType) -> c_uint;
1902 /// Only available on `libclang` 8.0 and later.
Haibo Huang8b9513e2020-07-13 22:05:39 -07001903 #[cfg(feature = "clang_8_0")]
Chih-Hung Hsiehfab43802020-04-07 14:24:01 -07001904 pub fn clang_Type_getNullability(type_: CXType) -> CXTypeNullabilityKind;
1905 /// Only available on `libclang` 3.7 and later.
Haibo Huang8b9513e2020-07-13 22:05:39 -07001906 #[cfg(feature = "clang_3_7")]
Chih-Hung Hsiehfab43802020-04-07 14:24:01 -07001907 pub fn clang_Type_visitFields(type_: CXType, visitor: CXFieldVisitor, data: CXClientData) -> CXVisitorResult;
1908 pub fn clang_annotateTokens(tu: CXTranslationUnit, tokens: *mut CXToken, n_tokens: c_uint, cursors: *mut CXCursor);
1909 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;
1910 pub fn clang_codeCompleteGetContainerKind(results: *mut CXCodeCompleteResults, incomplete: *mut c_uint) -> CXCursorKind;
1911 pub fn clang_codeCompleteGetContainerUSR(results: *mut CXCodeCompleteResults) -> CXString;
1912 pub fn clang_codeCompleteGetContexts(results: *mut CXCodeCompleteResults) -> c_ulonglong;
1913 pub fn clang_codeCompleteGetDiagnostic(results: *mut CXCodeCompleteResults, index: c_uint) -> CXDiagnostic;
1914 pub fn clang_codeCompleteGetNumDiagnostics(results: *mut CXCodeCompleteResults) -> c_uint;
1915 pub fn clang_codeCompleteGetObjCSelector(results: *mut CXCodeCompleteResults) -> CXString;
1916 pub fn clang_constructUSR_ObjCCategory(class: *const c_char, category: *const c_char) -> CXString;
1917 pub fn clang_constructUSR_ObjCClass(class: *const c_char) -> CXString;
1918 pub fn clang_constructUSR_ObjCIvar(name: *const c_char, usr: CXString) -> CXString;
1919 pub fn clang_constructUSR_ObjCMethod(name: *const c_char, instance: c_uint, usr: CXString) -> CXString;
1920 pub fn clang_constructUSR_ObjCProperty(property: *const c_char, usr: CXString) -> CXString;
1921 pub fn clang_constructUSR_ObjCProtocol(protocol: *const c_char) -> CXString;
1922 pub fn clang_createCXCursorSet() -> CXCursorSet;
1923 pub fn clang_createIndex(exclude: c_int, display: c_int) -> CXIndex;
1924 pub fn clang_createTranslationUnit(index: CXIndex, file: *const c_char) -> CXTranslationUnit;
1925 pub fn clang_createTranslationUnit2(index: CXIndex, file: *const c_char, tu: *mut CXTranslationUnit) -> CXErrorCode;
1926 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;
1927 pub fn clang_defaultCodeCompleteOptions() -> CXCodeComplete_Flags;
1928 pub fn clang_defaultDiagnosticDisplayOptions() -> CXDiagnosticDisplayOptions;
1929 pub fn clang_defaultEditingTranslationUnitOptions() -> CXTranslationUnit_Flags;
1930 pub fn clang_defaultReparseOptions(tu: CXTranslationUnit) -> CXReparse_Flags;
1931 pub fn clang_defaultSaveOptions(tu: CXTranslationUnit) -> CXSaveTranslationUnit_Flags;
1932 pub fn clang_disposeCXCursorSet(set: CXCursorSet);
1933 pub fn clang_disposeCXPlatformAvailability(availability: *mut CXPlatformAvailability);
1934 pub fn clang_disposeCXTUResourceUsage(usage: CXTUResourceUsage);
1935 pub fn clang_disposeCodeCompleteResults(results: *mut CXCodeCompleteResults);
1936 pub fn clang_disposeDiagnostic(diagnostic: CXDiagnostic);
1937 pub fn clang_disposeDiagnosticSet(diagnostic: CXDiagnosticSet);
1938 pub fn clang_disposeIndex(index: CXIndex);
1939 pub fn clang_disposeOverriddenCursors(cursors: *mut CXCursor);
1940 pub fn clang_disposeSourceRangeList(list: *mut CXSourceRangeList);
1941 pub fn clang_disposeString(string: CXString);
1942 /// Only available on `libclang` 3.8 and later.
Haibo Huang8b9513e2020-07-13 22:05:39 -07001943 #[cfg(feature = "clang_3_8")]
Chih-Hung Hsiehfab43802020-04-07 14:24:01 -07001944 pub fn clang_disposeStringSet(set: *mut CXStringSet);
1945 pub fn clang_disposeTokens(tu: CXTranslationUnit, tokens: *mut CXToken, n_tokens: c_uint);
1946 pub fn clang_disposeTranslationUnit(tu: CXTranslationUnit);
1947 pub fn clang_enableStackTraces();
1948 pub fn clang_equalCursors(left: CXCursor, right: CXCursor) -> c_uint;
1949 pub fn clang_equalLocations(left: CXSourceLocation, right: CXSourceLocation) -> c_uint;
1950 pub fn clang_equalRanges(left: CXSourceRange, right: CXSourceRange) -> c_uint;
1951 pub fn clang_equalTypes(left: CXType, right: CXType) -> c_uint;
1952 pub fn clang_executeOnThread(function: extern fn(*mut c_void), data: *mut c_void, stack: c_uint);
1953 pub fn clang_findIncludesInFile(tu: CXTranslationUnit, file: CXFile, cursor: CXCursorAndRangeVisitor) -> CXResult;
1954 pub fn clang_findReferencesInFile(cursor: CXCursor, file: CXFile, visitor: CXCursorAndRangeVisitor) -> CXResult;
1955 pub fn clang_formatDiagnostic(diagnostic: CXDiagnostic, flags: CXDiagnosticDisplayOptions) -> CXString;
1956 /// Only available on `libclang` 3.7 and later.
Haibo Huang8b9513e2020-07-13 22:05:39 -07001957 #[cfg(feature = "clang_3_7")]
Chih-Hung Hsiehfab43802020-04-07 14:24:01 -07001958 pub fn clang_free(buffer: *mut c_void);
1959 /// Only available on `libclang` 5.0 and later.
Haibo Huang8b9513e2020-07-13 22:05:39 -07001960 #[cfg(feature = "clang_5_0")]
Chih-Hung Hsiehfab43802020-04-07 14:24:01 -07001961 pub fn clang_getAddressSpace(type_: CXType) -> c_uint;
1962 /// Only available on `libclang` 4.0 and later.
Haibo Huang8b9513e2020-07-13 22:05:39 -07001963 #[cfg(feature = "clang_4_0")]
Chih-Hung Hsiehfab43802020-04-07 14:24:01 -07001964 pub fn clang_getAllSkippedRanges(tu: CXTranslationUnit) -> *mut CXSourceRangeList;
1965 pub fn clang_getArgType(type_: CXType, index: c_uint) -> CXType;
1966 pub fn clang_getArrayElementType(type_: CXType) -> CXType;
1967 pub fn clang_getArraySize(type_: CXType) -> c_longlong;
1968 pub fn clang_getCString(string: CXString) -> *const c_char;
1969 pub fn clang_getCXTUResourceUsage(tu: CXTranslationUnit) -> CXTUResourceUsage;
1970 pub fn clang_getCXXAccessSpecifier(cursor: CXCursor) -> CX_CXXAccessSpecifier;
1971 pub fn clang_getCanonicalCursor(cursor: CXCursor) -> CXCursor;
1972 pub fn clang_getCanonicalType(type_: CXType) -> CXType;
1973 pub fn clang_getChildDiagnostics(diagnostic: CXDiagnostic) -> CXDiagnosticSet;
1974 pub fn clang_getClangVersion() -> CXString;
1975 pub fn clang_getCompletionAnnotation(string: CXCompletionString, index: c_uint) -> CXString;
1976 pub fn clang_getCompletionAvailability(string: CXCompletionString) -> CXAvailabilityKind;
1977 pub fn clang_getCompletionBriefComment(string: CXCompletionString) -> CXString;
1978 pub fn clang_getCompletionChunkCompletionString(string: CXCompletionString, index: c_uint) -> CXCompletionString;
1979 pub fn clang_getCompletionChunkKind(string: CXCompletionString, index: c_uint) -> CXCompletionChunkKind;
1980 pub fn clang_getCompletionChunkText(string: CXCompletionString, index: c_uint) -> CXString;
1981 /// Only available on `libclang` 7.0 and later.
Haibo Huang8b9513e2020-07-13 22:05:39 -07001982 #[cfg(feature = "clang_7_0")]
Chih-Hung Hsiehfab43802020-04-07 14:24:01 -07001983 pub fn clang_getCompletionFixIt(results: *mut CXCodeCompleteResults, completion_index: c_uint, fixit_index: c_uint, range: *mut CXSourceRange) -> CXString;
1984 pub fn clang_getCompletionNumAnnotations(string: CXCompletionString) -> c_uint;
1985 /// Only available on `libclang` 7.0 and later.
Haibo Huang8b9513e2020-07-13 22:05:39 -07001986 #[cfg(feature = "clang_7_0")]
Chih-Hung Hsiehfab43802020-04-07 14:24:01 -07001987 pub fn clang_getCompletionNumFixIts(results: *mut CXCodeCompleteResults, completion_index: c_uint) -> c_uint;
1988 pub fn clang_getCompletionParent(string: CXCompletionString, kind: *mut CXCursorKind) -> CXString;
1989 pub fn clang_getCompletionPriority(string: CXCompletionString) -> c_uint;
1990 pub fn clang_getCursor(tu: CXTranslationUnit, location: CXSourceLocation) -> CXCursor;
1991 pub fn clang_getCursorAvailability(cursor: CXCursor) -> CXAvailabilityKind;
1992 pub fn clang_getCursorCompletionString(cursor: CXCursor) -> CXCompletionString;
1993 pub fn clang_getCursorDefinition(cursor: CXCursor) -> CXCursor;
1994 pub fn clang_getCursorDisplayName(cursor: CXCursor) -> CXString;
1995 /// Only available on `libclang` 5.0 and later.
Haibo Huang8b9513e2020-07-13 22:05:39 -07001996 #[cfg(feature = "clang_5_0")]
Chih-Hung Hsiehfab43802020-04-07 14:24:01 -07001997 pub fn clang_getCursorExceptionSpecificationType(cursor: CXCursor) -> CXCursor_ExceptionSpecificationKind;
1998 pub fn clang_getCursorExtent(cursor: CXCursor) -> CXSourceRange;
1999 pub fn clang_getCursorKind(cursor: CXCursor) -> CXCursorKind;
2000 pub fn clang_getCursorKindSpelling(kind: CXCursorKind) -> CXString;
2001 pub fn clang_getCursorLanguage(cursor: CXCursor) -> CXLanguageKind;
2002 pub fn clang_getCursorLexicalParent(cursor: CXCursor) -> CXCursor;
2003 pub fn clang_getCursorLinkage(cursor: CXCursor) -> CXLinkageKind;
2004 pub fn clang_getCursorLocation(cursor: CXCursor) -> CXSourceLocation;
2005 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;
2006 /// Only available on `libclang` 7.0 and later.
Haibo Huang8b9513e2020-07-13 22:05:39 -07002007 #[cfg(feature = "clang_7_0")]
Chih-Hung Hsiehfab43802020-04-07 14:24:01 -07002008 pub fn clang_getCursorPrettyPrinted(cursor: CXCursor, policy: CXPrintingPolicy) -> CXString;
2009 /// Only available on `libclang` 7.0 and later.
Haibo Huang8b9513e2020-07-13 22:05:39 -07002010 #[cfg(feature = "clang_7_0")]
Chih-Hung Hsiehfab43802020-04-07 14:24:01 -07002011 pub fn clang_getCursorPrintingPolicy(cursor: CXCursor) -> CXPrintingPolicy;
2012 pub fn clang_getCursorReferenceNameRange(cursor: CXCursor, flags: CXNameRefFlags, index: c_uint) -> CXSourceRange;
2013 pub fn clang_getCursorReferenced(cursor: CXCursor) -> CXCursor;
2014 pub fn clang_getCursorResultType(cursor: CXCursor) -> CXType;
2015 pub fn clang_getCursorSemanticParent(cursor: CXCursor) -> CXCursor;
2016 pub fn clang_getCursorSpelling(cursor: CXCursor) -> CXString;
2017 /// Only available on `libclang` 6.0 and later.
Haibo Huang8b9513e2020-07-13 22:05:39 -07002018 #[cfg(feature = "clang_6_0")]
Chih-Hung Hsiehfab43802020-04-07 14:24:01 -07002019 pub fn clang_getCursorTLSKind(cursor: CXCursor) -> CXTLSKind;
2020 pub fn clang_getCursorType(cursor: CXCursor) -> CXType;
2021 pub fn clang_getCursorUSR(cursor: CXCursor) -> CXString;
2022 /// Only available on `libclang` 3.8 and later.
Haibo Huang8b9513e2020-07-13 22:05:39 -07002023 #[cfg(feature = "clang_3_8")]
Chih-Hung Hsiehfab43802020-04-07 14:24:01 -07002024 pub fn clang_getCursorVisibility(cursor: CXCursor) -> CXVisibilityKind;
2025 pub fn clang_getDeclObjCTypeEncoding(cursor: CXCursor) -> CXString;
2026 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);
2027 pub fn clang_getDiagnostic(tu: CXTranslationUnit, index: c_uint) -> CXDiagnostic;
2028 pub fn clang_getDiagnosticCategory(diagnostic: CXDiagnostic) -> c_uint;
2029 pub fn clang_getDiagnosticCategoryName(category: c_uint) -> CXString;
2030 pub fn clang_getDiagnosticCategoryText(diagnostic: CXDiagnostic) -> CXString;
2031 pub fn clang_getDiagnosticFixIt(diagnostic: CXDiagnostic, index: c_uint, range: *mut CXSourceRange) -> CXString;
2032 pub fn clang_getDiagnosticInSet(diagnostic: CXDiagnosticSet, index: c_uint) -> CXDiagnostic;
2033 pub fn clang_getDiagnosticLocation(diagnostic: CXDiagnostic) -> CXSourceLocation;
2034 pub fn clang_getDiagnosticNumFixIts(diagnostic: CXDiagnostic) -> c_uint;
2035 pub fn clang_getDiagnosticNumRanges(diagnostic: CXDiagnostic) -> c_uint;
2036 pub fn clang_getDiagnosticOption(diagnostic: CXDiagnostic, option: *mut CXString) -> CXString;
2037 pub fn clang_getDiagnosticRange(diagnostic: CXDiagnostic, index: c_uint) -> CXSourceRange;
2038 pub fn clang_getDiagnosticSetFromTU(tu: CXTranslationUnit) -> CXDiagnosticSet;
2039 pub fn clang_getDiagnosticSeverity(diagnostic: CXDiagnostic) -> CXDiagnosticSeverity;
2040 pub fn clang_getDiagnosticSpelling(diagnostic: CXDiagnostic) -> CXString;
2041 pub fn clang_getElementType(type_: CXType) -> CXType;
2042 pub fn clang_getEnumConstantDeclUnsignedValue(cursor: CXCursor) -> c_ulonglong;
2043 pub fn clang_getEnumConstantDeclValue(cursor: CXCursor) -> c_longlong;
2044 pub fn clang_getEnumDeclIntegerType(cursor: CXCursor) -> CXType;
2045 /// Only available on `libclang` 5.0 and later.
Haibo Huang8b9513e2020-07-13 22:05:39 -07002046 #[cfg(feature = "clang_5_0")]
Chih-Hung Hsiehfab43802020-04-07 14:24:01 -07002047 pub fn clang_getExceptionSpecificationType(type_: CXType) -> CXCursor_ExceptionSpecificationKind;
2048 pub fn clang_getExpansionLocation(location: CXSourceLocation, file: *mut CXFile, line: *mut c_uint, column: *mut c_uint, offset: *mut c_uint);
2049 pub fn clang_getFieldDeclBitWidth(cursor: CXCursor) -> c_int;
2050 pub fn clang_getFile(tu: CXTranslationUnit, file: *const c_char) -> CXFile;
2051 /// Only available on `libclang` 6.0 and later.
Haibo Huang8b9513e2020-07-13 22:05:39 -07002052 #[cfg(feature = "clang_6_0")]
Chih-Hung Hsiehfab43802020-04-07 14:24:01 -07002053 pub fn clang_getFileContents(tu: CXTranslationUnit, file: CXFile, size: *mut size_t) -> *const c_char;
2054 pub fn clang_getFileLocation(location: CXSourceLocation, file: *mut CXFile, line: *mut c_uint, column: *mut c_uint, offset: *mut c_uint);
2055 pub fn clang_getFileName(file: CXFile) -> CXString;
2056 pub fn clang_getFileTime(file: CXFile) -> time_t;
2057 pub fn clang_getFileUniqueID(file: CXFile, id: *mut CXFileUniqueID) -> c_int;
2058 pub fn clang_getFunctionTypeCallingConv(type_: CXType) -> CXCallingConv;
2059 pub fn clang_getIBOutletCollectionType(cursor: CXCursor) -> CXType;
2060 pub fn clang_getIncludedFile(cursor: CXCursor) -> CXFile;
2061 pub fn clang_getInclusions(tu: CXTranslationUnit, visitor: CXInclusionVisitor, data: CXClientData);
2062 pub fn clang_getInstantiationLocation(location: CXSourceLocation, file: *mut CXFile, line: *mut c_uint, column: *mut c_uint, offset: *mut c_uint);
2063 pub fn clang_getLocation(tu: CXTranslationUnit, file: CXFile, line: c_uint, column: c_uint) -> CXSourceLocation;
2064 pub fn clang_getLocationForOffset(tu: CXTranslationUnit, file: CXFile, offset: c_uint) -> CXSourceLocation;
2065 pub fn clang_getModuleForFile(tu: CXTranslationUnit, file: CXFile) -> CXModule;
2066 pub fn clang_getNullCursor() -> CXCursor;
2067 pub fn clang_getNullLocation() -> CXSourceLocation;
2068 pub fn clang_getNullRange() -> CXSourceRange;
2069 pub fn clang_getNumArgTypes(type_: CXType) -> c_int;
2070 pub fn clang_getNumCompletionChunks(string: CXCompletionString) -> c_uint;
2071 pub fn clang_getNumDiagnostics(tu: CXTranslationUnit) -> c_uint;
2072 pub fn clang_getNumDiagnosticsInSet(diagnostic: CXDiagnosticSet) -> c_uint;
2073 pub fn clang_getNumElements(type_: CXType) -> c_longlong;
2074 pub fn clang_getNumOverloadedDecls(cursor: CXCursor) -> c_uint;
2075 pub fn clang_getOverloadedDecl(cursor: CXCursor, index: c_uint) -> CXCursor;
2076 pub fn clang_getOverriddenCursors(cursor: CXCursor, cursors: *mut *mut CXCursor, n_cursors: *mut c_uint);
2077 pub fn clang_getPointeeType(type_: CXType) -> CXType;
2078 pub fn clang_getPresumedLocation(location: CXSourceLocation, file: *mut CXString, line: *mut c_uint, column: *mut c_uint);
2079 pub fn clang_getRange(start: CXSourceLocation, end: CXSourceLocation) -> CXSourceRange;
2080 pub fn clang_getRangeEnd(range: CXSourceRange) -> CXSourceLocation;
2081 pub fn clang_getRangeStart(range: CXSourceRange) -> CXSourceLocation;
2082 pub fn clang_getRemappings(file: *const c_char) -> CXRemapping;
2083 pub fn clang_getRemappingsFromFileList(files: *mut *const c_char, n_files: c_uint) -> CXRemapping;
2084 pub fn clang_getResultType(type_: CXType) -> CXType;
2085 pub fn clang_getSkippedRanges(tu: CXTranslationUnit, file: CXFile) -> *mut CXSourceRangeList;
2086 pub fn clang_getSpecializedCursorTemplate(cursor: CXCursor) -> CXCursor;
2087 pub fn clang_getSpellingLocation(location: CXSourceLocation, file: *mut CXFile, line: *mut c_uint, column: *mut c_uint, offset: *mut c_uint);
2088 pub fn clang_getTUResourceUsageName(kind: CXTUResourceUsageKind) -> *const c_char;
2089 /// Only available on `libclang` 5.0 and later.
Haibo Huang8b9513e2020-07-13 22:05:39 -07002090 #[cfg(feature = "clang_5_0")]
Chih-Hung Hsiehfab43802020-04-07 14:24:01 -07002091 pub fn clang_getTranslationUnitTargetInfo(tu: CXTranslationUnit) -> CXTargetInfo;
2092 pub fn clang_getTemplateCursorKind(cursor: CXCursor) -> CXCursorKind;
2093 pub fn clang_getTokenExtent(tu: CXTranslationUnit, token: CXToken) -> CXSourceRange;
2094 pub fn clang_getTokenKind(token: CXToken) -> CXTokenKind;
2095 pub fn clang_getTokenLocation(tu: CXTranslationUnit, token: CXToken) -> CXSourceLocation;
2096 pub fn clang_getTokenSpelling(tu: CXTranslationUnit, token: CXToken) -> CXString;
2097 pub fn clang_getTranslationUnitCursor(tu: CXTranslationUnit) -> CXCursor;
2098 pub fn clang_getTranslationUnitSpelling(tu: CXTranslationUnit) -> CXString;
2099 pub fn clang_getTypeDeclaration(type_: CXType) -> CXCursor;
2100 pub fn clang_getTypeKindSpelling(type_: CXTypeKind) -> CXString;
2101 pub fn clang_getTypeSpelling(type_: CXType) -> CXString;
2102 pub fn clang_getTypedefDeclUnderlyingType(cursor: CXCursor) -> CXType;
2103 /// Only available on `libclang` 5.0 and later.
Haibo Huang8b9513e2020-07-13 22:05:39 -07002104 #[cfg(feature = "clang_5_0")]
Chih-Hung Hsiehfab43802020-04-07 14:24:01 -07002105 pub fn clang_getTypedefName(type_: CXType) -> CXString;
2106 pub fn clang_hashCursor(cursor: CXCursor) -> c_uint;
2107 pub fn clang_indexLoc_getCXSourceLocation(location: CXIdxLoc) -> CXSourceLocation;
2108 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);
2109 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;
2110 /// Only available on `libclang` 3.8 and later.
Haibo Huang8b9513e2020-07-13 22:05:39 -07002111 #[cfg(feature = "clang_3_8")]
Chih-Hung Hsiehfab43802020-04-07 14:24:01 -07002112 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;
2113 pub fn clang_indexTranslationUnit(index: CXIndexAction, data: CXClientData, callbacks: *mut IndexerCallbacks, n_callbacks: c_uint, flags: CXIndexOptFlags, tu: CXTranslationUnit) -> c_int;
2114 pub fn clang_index_getCXXClassDeclInfo(info: *const CXIdxDeclInfo) -> *const CXIdxCXXClassDeclInfo;
2115 pub fn clang_index_getClientContainer(info: *const CXIdxContainerInfo) -> CXIdxClientContainer;
2116 pub fn clang_index_getClientEntity(info: *const CXIdxEntityInfo) -> CXIdxClientEntity;
2117 pub fn clang_index_getIBOutletCollectionAttrInfo(info: *const CXIdxAttrInfo) -> *const CXIdxIBOutletCollectionAttrInfo;
2118 pub fn clang_index_getObjCCategoryDeclInfo(info: *const CXIdxDeclInfo) -> *const CXIdxObjCCategoryDeclInfo;
2119 pub fn clang_index_getObjCContainerDeclInfo(info: *const CXIdxDeclInfo) -> *const CXIdxObjCContainerDeclInfo;
2120 pub fn clang_index_getObjCInterfaceDeclInfo(info: *const CXIdxDeclInfo) -> *const CXIdxObjCInterfaceDeclInfo;
2121 pub fn clang_index_getObjCPropertyDeclInfo(info: *const CXIdxDeclInfo) -> *const CXIdxObjCPropertyDeclInfo;
2122 pub fn clang_index_getObjCProtocolRefListInfo(info: *const CXIdxDeclInfo) -> *const CXIdxObjCProtocolRefListInfo;
2123 pub fn clang_index_isEntityObjCContainerKind(info: CXIdxEntityKind) -> c_int;
2124 pub fn clang_index_setClientContainer(info: *const CXIdxContainerInfo, container: CXIdxClientContainer);
2125 pub fn clang_index_setClientEntity(info: *const CXIdxEntityInfo, entity: CXIdxClientEntity);
2126 pub fn clang_isAttribute(kind: CXCursorKind) -> c_uint;
2127 pub fn clang_isConstQualifiedType(type_: CXType) -> c_uint;
2128 pub fn clang_isCursorDefinition(cursor: CXCursor) -> c_uint;
2129 pub fn clang_isDeclaration(kind: CXCursorKind) -> c_uint;
2130 pub fn clang_isExpression(kind: CXCursorKind) -> c_uint;
2131 pub fn clang_isFileMultipleIncludeGuarded(tu: CXTranslationUnit, file: CXFile) -> c_uint;
2132 pub fn clang_isFunctionTypeVariadic(type_: CXType) -> c_uint;
2133 pub fn clang_isInvalid(kind: CXCursorKind) -> c_uint;
2134 /// Only available on `libclang` 7.0 and later.
Haibo Huang8b9513e2020-07-13 22:05:39 -07002135 #[cfg(feature = "clang_7_0")]
Chih-Hung Hsiehfab43802020-04-07 14:24:01 -07002136 pub fn clang_isInvalidDeclaration(cursor: CXCursor) -> c_uint;
2137 pub fn clang_isPODType(type_: CXType) -> c_uint;
2138 pub fn clang_isPreprocessing(kind: CXCursorKind) -> c_uint;
2139 pub fn clang_isReference(kind: CXCursorKind) -> c_uint;
2140 pub fn clang_isRestrictQualifiedType(type_: CXType) -> c_uint;
2141 pub fn clang_isStatement(kind: CXCursorKind) -> c_uint;
2142 pub fn clang_isTranslationUnit(kind: CXCursorKind) -> c_uint;
2143 pub fn clang_isUnexposed(kind: CXCursorKind) -> c_uint;
2144 pub fn clang_isVirtualBase(cursor: CXCursor) -> c_uint;
2145 pub fn clang_isVolatileQualifiedType(type_: CXType) -> c_uint;
2146 pub fn clang_loadDiagnostics(file: *const c_char, error: *mut CXLoadDiag_Error, message: *mut CXString) -> CXDiagnosticSet;
2147 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;
2148 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;
2149 /// Only available on `libclang` 3.8 and later.
Haibo Huang8b9513e2020-07-13 22:05:39 -07002150 #[cfg(feature = "clang_3_8")]
Chih-Hung Hsiehfab43802020-04-07 14:24:01 -07002151 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;
2152 pub fn clang_remap_dispose(remapping: CXRemapping);
2153 pub fn clang_remap_getFilenames(remapping: CXRemapping, index: c_uint, original: *mut CXString, transformed: *mut CXString);
2154 pub fn clang_remap_getNumFiles(remapping: CXRemapping) -> c_uint;
2155 pub fn clang_reparseTranslationUnit(tu: CXTranslationUnit, n_unsaved: c_uint, unsaved: *mut CXUnsavedFile, flags: CXReparse_Flags) -> CXErrorCode;
2156 pub fn clang_saveTranslationUnit(tu: CXTranslationUnit, file: *const c_char, options: CXSaveTranslationUnit_Flags) -> CXSaveError;
2157 pub fn clang_sortCodeCompletionResults(results: *mut CXCompletionResult, n_results: c_uint);
2158 /// Only available on `libclang` 5.0 and later.
Haibo Huang8b9513e2020-07-13 22:05:39 -07002159 #[cfg(feature = "clang_5_0")]
Chih-Hung Hsiehfab43802020-04-07 14:24:01 -07002160 pub fn clang_suspendTranslationUnit(tu: CXTranslationUnit) -> c_uint;
2161 pub fn clang_toggleCrashRecovery(recovery: c_uint);
2162 pub fn clang_tokenize(tu: CXTranslationUnit, range: CXSourceRange, tokens: *mut *mut CXToken, n_tokens: *mut c_uint);
2163 pub fn clang_visitChildren(cursor: CXCursor, visitor: CXCursorVisitor, data: CXClientData) -> c_uint;
2164
2165 // Documentation
2166 pub fn clang_BlockCommandComment_getArgText(comment: CXComment, index: c_uint) -> CXString;
2167 pub fn clang_BlockCommandComment_getCommandName(comment: CXComment) -> CXString;
2168 pub fn clang_BlockCommandComment_getNumArgs(comment: CXComment) -> c_uint;
2169 pub fn clang_BlockCommandComment_getParagraph(comment: CXComment) -> CXComment;
2170 pub fn clang_Comment_getChild(comment: CXComment, index: c_uint) -> CXComment;
2171 pub fn clang_Comment_getKind(comment: CXComment) -> CXCommentKind;
2172 pub fn clang_Comment_getNumChildren(comment: CXComment) -> c_uint;
2173 pub fn clang_Comment_isWhitespace(comment: CXComment) -> c_uint;
2174 pub fn clang_Cursor_getParsedComment(C: CXCursor) -> CXComment;
2175 pub fn clang_FullComment_getAsHTML(comment: CXComment) -> CXString;
2176 pub fn clang_FullComment_getAsXML(comment: CXComment) -> CXString;
2177 pub fn clang_HTMLStartTagComment_isSelfClosing(comment: CXComment) -> c_uint;
2178 pub fn clang_HTMLStartTag_getAttrName(comment: CXComment, index: c_uint) -> CXString;
2179 pub fn clang_HTMLStartTag_getAttrValue(comment: CXComment, index: c_uint) -> CXString;
2180 pub fn clang_HTMLStartTag_getNumAttrs(comment: CXComment) -> c_uint;
2181 pub fn clang_HTMLTagComment_getAsString(comment: CXComment) -> CXString;
2182 pub fn clang_HTMLTagComment_getTagName(comment: CXComment) -> CXString;
2183 pub fn clang_InlineCommandComment_getArgText(comment: CXComment, index: c_uint) -> CXString;
2184 pub fn clang_InlineCommandComment_getCommandName(comment: CXComment) -> CXString;
2185 pub fn clang_InlineCommandComment_getNumArgs(comment: CXComment) -> c_uint;
2186 pub fn clang_InlineCommandComment_getRenderKind(comment: CXComment) -> CXCommentInlineCommandRenderKind;
2187 pub fn clang_InlineContentComment_hasTrailingNewline(comment: CXComment) -> c_uint;
2188 pub fn clang_ParamCommandComment_getDirection(comment: CXComment) -> CXCommentParamPassDirection;
2189 pub fn clang_ParamCommandComment_getParamIndex(comment: CXComment) -> c_uint;
2190 pub fn clang_ParamCommandComment_getParamName(comment: CXComment) -> CXString;
2191 pub fn clang_ParamCommandComment_isDirectionExplicit(comment: CXComment) -> c_uint;
2192 pub fn clang_ParamCommandComment_isParamIndexValid(comment: CXComment) -> c_uint;
2193 pub fn clang_TParamCommandComment_getDepth(comment: CXComment) -> c_uint;
2194 pub fn clang_TParamCommandComment_getIndex(comment: CXComment, depth: c_uint) -> c_uint;
2195 pub fn clang_TParamCommandComment_getParamName(comment: CXComment) -> CXString;
2196 pub fn clang_TParamCommandComment_isParamPositionValid(comment: CXComment) -> c_uint;
2197 pub fn clang_TextComment_getText(comment: CXComment) -> CXString;
2198 pub fn clang_VerbatimBlockLineComment_getText(comment: CXComment) -> CXString;
2199 pub fn clang_VerbatimLineComment_getText(comment: CXComment) -> CXString;
2200}