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