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