clang 19.0.0git
Classes | Typedefs | Enumerations | Functions
Higher level API functions
Collaboration diagram for Higher level API functions:

Classes

struct  CXCursorAndRangeVisitor
 
struct  CXIdxLoc
 Source location passed to index callbacks. More...
 
struct  CXIdxIncludedFileInfo
 Data for ppIncludedFile callback. More...
 
struct  CXIdxImportedASTFileInfo
 Data for IndexerCallbacks::importedASTFile. More...
 
struct  CXIdxAttrInfo
 
struct  CXIdxEntityInfo
 
struct  CXIdxContainerInfo
 
struct  CXIdxIBOutletCollectionAttrInfo
 
struct  CXIdxDeclInfo
 
struct  CXIdxObjCContainerDeclInfo
 
struct  CXIdxBaseClassInfo
 
struct  CXIdxObjCProtocolRefInfo
 
struct  CXIdxObjCProtocolRefListInfo
 
struct  CXIdxObjCInterfaceDeclInfo
 
struct  CXIdxObjCCategoryDeclInfo
 
struct  CXIdxObjCPropertyDeclInfo
 
struct  CXIdxCXXClassDeclInfo
 
struct  CXIdxEntityRefInfo
 Data for IndexerCallbacks::indexEntityReference. More...
 
struct  IndexerCallbacks
 A group of callbacks used by clang_indexSourceFile and clang_indexTranslationUnit. More...
 

Typedefs

typedef struct CXCursorAndRangeVisitor CXCursorAndRangeVisitor
 
typedef struct _CXCursorAndRangeVisitorBlock * CXCursorAndRangeVisitorBlock
 
typedef void * CXIdxClientFile
 The client's data object that is associated with a CXFile.
 
typedef void * CXIdxClientEntity
 The client's data object that is associated with a semantic entity.
 
typedef void * CXIdxClientContainer
 The client's data object that is associated with a semantic container of entities.
 
typedef void * CXIdxClientASTFile
 The client's data object that is associated with an AST file (PCH or module).
 
typedef void * CXIndexAction
 An indexing action/session, to be applied to one or multiple translation units.
 
typedef enum CXVisitorResult(* CXFieldVisitor) (CXCursor C, CXClientData client_data)
 Visitor invoked for each field found by a traversal.
 

Enumerations

enum  CXVisitorResult { CXVisit_Break , CXVisit_Continue }
 
enum  CXResult { CXResult_Success = 0 , CXResult_Invalid = 1 , CXResult_VisitBreak = 2 }
 
enum  CXIdxEntityKind {
  CXIdxEntity_Unexposed = 0 , CXIdxEntity_Typedef = 1 , CXIdxEntity_Function = 2 , CXIdxEntity_Variable = 3 ,
  CXIdxEntity_Field = 4 , CXIdxEntity_EnumConstant = 5 , CXIdxEntity_ObjCClass = 6 , CXIdxEntity_ObjCProtocol = 7 ,
  CXIdxEntity_ObjCCategory = 8 , CXIdxEntity_ObjCInstanceMethod = 9 , CXIdxEntity_ObjCClassMethod = 10 , CXIdxEntity_ObjCProperty = 11 ,
  CXIdxEntity_ObjCIvar = 12 , CXIdxEntity_Enum = 13 , CXIdxEntity_Struct = 14 , CXIdxEntity_Union = 15 ,
  CXIdxEntity_CXXClass = 16 , CXIdxEntity_CXXNamespace = 17 , CXIdxEntity_CXXNamespaceAlias = 18 , CXIdxEntity_CXXStaticVariable = 19 ,
  CXIdxEntity_CXXStaticMethod = 20 , CXIdxEntity_CXXInstanceMethod = 21 , CXIdxEntity_CXXConstructor = 22 , CXIdxEntity_CXXDestructor = 23 ,
  CXIdxEntity_CXXConversionFunction = 24 , CXIdxEntity_CXXTypeAlias = 25 , CXIdxEntity_CXXInterface = 26 , CXIdxEntity_CXXConcept = 27
}
 
enum  CXIdxEntityLanguage {
  CXIdxEntityLang_None = 0 , CXIdxEntityLang_C = 1 , CXIdxEntityLang_ObjC = 2 , CXIdxEntityLang_CXX = 3 ,
  CXIdxEntityLang_Swift = 4
}
 
enum  CXIdxEntityCXXTemplateKind { CXIdxEntity_NonTemplate = 0 , CXIdxEntity_Template = 1 , CXIdxEntity_TemplatePartialSpecialization = 2 , CXIdxEntity_TemplateSpecialization = 3 }
 Extra C++ template information for an entity. More...
 
enum  CXIdxAttrKind { CXIdxAttr_Unexposed = 0 , CXIdxAttr_IBAction = 1 , CXIdxAttr_IBOutlet = 2 , CXIdxAttr_IBOutletCollection = 3 }
 
enum  CXIdxDeclInfoFlags { CXIdxDeclFlag_Skipped = 0x1 }
 
enum  CXIdxObjCContainerKind { CXIdxObjCContainer_ForwardRef = 0 , CXIdxObjCContainer_Interface = 1 , CXIdxObjCContainer_Implementation = 2 }
 
enum  CXIdxEntityRefKind { CXIdxEntityRef_Direct = 1 , CXIdxEntityRef_Implicit = 2 }
 Data for IndexerCallbacks::indexEntityReference. More...
 
enum  CXSymbolRole {
  CXSymbolRole_None = 0 , CXSymbolRole_Declaration = 1 << 0 , CXSymbolRole_Definition = 1 << 1 , CXSymbolRole_Reference = 1 << 2 ,
  CXSymbolRole_Read = 1 << 3 , CXSymbolRole_Write = 1 << 4 , CXSymbolRole_Call = 1 << 5 , CXSymbolRole_Dynamic = 1 << 6 ,
  CXSymbolRole_AddressOf = 1 << 7 , CXSymbolRole_Implicit = 1 << 8
}
 Roles that are attributed to symbol occurrences. More...
 
enum  CXIndexOptFlags {
  CXIndexOpt_None = 0x0 , CXIndexOpt_SuppressRedundantRefs = 0x1 , CXIndexOpt_IndexFunctionLocalSymbols = 0x2 , CXIndexOpt_IndexImplicitTemplateInstantiations = 0x4 ,
  CXIndexOpt_SuppressWarnings = 0x8 , CXIndexOpt_SkipParsedBodiesInSession = 0x10
}
 
enum  CXBinaryOperatorKind {
  CXBinaryOperator_Invalid , CXBinaryOperator_PtrMemD , CXBinaryOperator_PtrMemI , CXBinaryOperator_Mul ,
  CXBinaryOperator_Div , CXBinaryOperator_Rem , CXBinaryOperator_Add , CXBinaryOperator_Sub ,
  CXBinaryOperator_Shl , CXBinaryOperator_Shr , CXBinaryOperator_Cmp , CXBinaryOperator_LT ,
  CXBinaryOperator_GT , CXBinaryOperator_LE , CXBinaryOperator_GE , CXBinaryOperator_EQ ,
  CXBinaryOperator_NE , CXBinaryOperator_And , CXBinaryOperator_Xor , CXBinaryOperator_Or ,
  CXBinaryOperator_LAnd , CXBinaryOperator_LOr , CXBinaryOperator_Assign , CXBinaryOperator_MulAssign ,
  CXBinaryOperator_DivAssign , CXBinaryOperator_RemAssign , CXBinaryOperator_AddAssign , CXBinaryOperator_SubAssign ,
  CXBinaryOperator_ShlAssign , CXBinaryOperator_ShrAssign , CXBinaryOperator_AndAssign , CXBinaryOperator_XorAssign ,
  CXBinaryOperator_OrAssign , CXBinaryOperator_Comma
}
 Describes the kind of binary operators. More...
 
enum  CXUnaryOperatorKind {
  CXUnaryOperator_Invalid , CXUnaryOperator_PostInc , CXUnaryOperator_PostDec , CXUnaryOperator_PreInc ,
  CXUnaryOperator_PreDec , CXUnaryOperator_AddrOf , CXUnaryOperator_Deref , CXUnaryOperator_Plus ,
  CXUnaryOperator_Minus , CXUnaryOperator_Not , CXUnaryOperator_LNot , CXUnaryOperator_Real ,
  CXUnaryOperator_Imag , CXUnaryOperator_Extension , CXUnaryOperator_Coawait
}
 Describes the kind of unary operators. More...
 

Functions

CINDEX_LINKAGE CXResult clang_findReferencesInFile (CXCursor cursor, CXFile file, CXCursorAndRangeVisitor visitor)
 Find references of a declaration in a specific file.
 
CINDEX_LINKAGE CXResult clang_findIncludesInFile (CXTranslationUnit TU, CXFile file, CXCursorAndRangeVisitor visitor)
 Find #import/#include directives in a specific file.
 
CINDEX_LINKAGE CXResult clang_findReferencesInFileWithBlock (CXCursor, CXFile, CXCursorAndRangeVisitorBlock)
 
CINDEX_LINKAGE CXResult clang_findIncludesInFileWithBlock (CXTranslationUnit, CXFile, CXCursorAndRangeVisitorBlock)
 
CINDEX_LINKAGE int clang_index_isEntityObjCContainerKind (CXIdxEntityKind)
 
CINDEX_LINKAGE const CXIdxObjCContainerDeclInfoclang_index_getObjCContainerDeclInfo (const CXIdxDeclInfo *)
 
CINDEX_LINKAGE const CXIdxObjCInterfaceDeclInfoclang_index_getObjCInterfaceDeclInfo (const CXIdxDeclInfo *)
 
CINDEX_LINKAGE const CXIdxObjCCategoryDeclInfoclang_index_getObjCCategoryDeclInfo (const CXIdxDeclInfo *)
 
CINDEX_LINKAGE const CXIdxObjCProtocolRefListInfoclang_index_getObjCProtocolRefListInfo (const CXIdxDeclInfo *)
 
CINDEX_LINKAGE const CXIdxObjCPropertyDeclInfoclang_index_getObjCPropertyDeclInfo (const CXIdxDeclInfo *)
 
CINDEX_LINKAGE const CXIdxIBOutletCollectionAttrInfoclang_index_getIBOutletCollectionAttrInfo (const CXIdxAttrInfo *)
 
CINDEX_LINKAGE const CXIdxCXXClassDeclInfoclang_index_getCXXClassDeclInfo (const CXIdxDeclInfo *)
 
CINDEX_LINKAGE CXIdxClientContainer clang_index_getClientContainer (const CXIdxContainerInfo *)
 For retrieving a custom CXIdxClientContainer attached to a container.
 
CINDEX_LINKAGE void clang_index_setClientContainer (const CXIdxContainerInfo *, CXIdxClientContainer)
 For setting a custom CXIdxClientContainer attached to a container.
 
CINDEX_LINKAGE CXIdxClientEntity clang_index_getClientEntity (const CXIdxEntityInfo *)
 For retrieving a custom CXIdxClientEntity attached to an entity.
 
CINDEX_LINKAGE void clang_index_setClientEntity (const CXIdxEntityInfo *, CXIdxClientEntity)
 For setting a custom CXIdxClientEntity attached to an entity.
 
CINDEX_LINKAGE CXIndexAction clang_IndexAction_create (CXIndex CIdx)
 An indexing action/session, to be applied to one or multiple translation units.
 
CINDEX_LINKAGE void clang_IndexAction_dispose (CXIndexAction)
 Destroy the given index action.
 
CINDEX_LINKAGE int clang_indexSourceFile (CXIndexAction, CXClientData client_data, IndexerCallbacks *index_callbacks, unsigned index_callbacks_size, unsigned index_options, const char *source_filename, const char *const *command_line_args, int num_command_line_args, struct CXUnsavedFile *unsaved_files, unsigned num_unsaved_files, CXTranslationUnit *out_TU, unsigned TU_options)
 Index the given source file and the translation unit corresponding to that file via callbacks implemented through IndexerCallbacks.
 
CINDEX_LINKAGE int clang_indexSourceFileFullArgv (CXIndexAction, CXClientData client_data, IndexerCallbacks *index_callbacks, unsigned index_callbacks_size, unsigned index_options, const char *source_filename, const char *const *command_line_args, int num_command_line_args, struct CXUnsavedFile *unsaved_files, unsigned num_unsaved_files, CXTranslationUnit *out_TU, unsigned TU_options)
 Same as clang_indexSourceFile but requires a full command line for command_line_args including argv[0].
 
CINDEX_LINKAGE int clang_indexTranslationUnit (CXIndexAction, CXClientData client_data, IndexerCallbacks *index_callbacks, unsigned index_callbacks_size, unsigned index_options, CXTranslationUnit)
 Index the given translation unit via callbacks implemented through IndexerCallbacks.
 
CINDEX_LINKAGE void clang_indexLoc_getFileLocation (CXIdxLoc loc, CXIdxClientFile *indexFile, CXFile *file, unsigned *line, unsigned *column, unsigned *offset)
 Retrieve the CXIdxFile, file, line, column, and offset represented by the given CXIdxLoc.
 
CINDEX_LINKAGE CXSourceLocation clang_indexLoc_getCXSourceLocation (CXIdxLoc loc)
 Retrieve the CXSourceLocation represented by the given CXIdxLoc.
 
CINDEX_LINKAGE unsigned clang_Type_visitFields (CXType T, CXFieldVisitor visitor, CXClientData client_data)
 Visit the fields of a particular type.
 
CINDEX_LINKAGE CXString clang_getBinaryOperatorKindSpelling (enum CXBinaryOperatorKind kind)
 Retrieve the spelling of a given CXBinaryOperatorKind.
 
CINDEX_LINKAGE enum CXBinaryOperatorKind clang_getCursorBinaryOperatorKind (CXCursor cursor)
 Retrieve the binary operator kind of this cursor.
 
CINDEX_LINKAGE CXString clang_getUnaryOperatorKindSpelling (enum CXUnaryOperatorKind kind)
 Retrieve the spelling of a given CXUnaryOperatorKind.
 
CINDEX_LINKAGE enum CXUnaryOperatorKind clang_getCursorUnaryOperatorKind (CXCursor cursor)
 Retrieve the unary operator kind of this cursor.
 

Detailed Description

Typedef Documentation

◆ CXCursorAndRangeVisitor

◆ CXCursorAndRangeVisitorBlock

typedef struct _CXCursorAndRangeVisitorBlock* CXCursorAndRangeVisitorBlock

Definition at line 5911 of file Index.h.

◆ CXFieldVisitor

typedef enum CXVisitorResult(* CXFieldVisitor) (CXCursor C, CXClientData client_data)

Visitor invoked for each field found by a traversal.

This visitor function will be invoked for each field found by clang_Type_visitFields. Its first argument is the cursor being visited, its second argument is the client data provided to clang_Type_visitFields.

The visitor should return one of the CXVisitorResult values to direct clang_Type_visitFields.

Definition at line 6496 of file Index.h.

◆ CXIdxClientASTFile

typedef void* CXIdxClientASTFile

The client's data object that is associated with an AST file (PCH or module).

Definition at line 5942 of file Index.h.

◆ CXIdxClientContainer

typedef void* CXIdxClientContainer

The client's data object that is associated with a semantic container of entities.

Definition at line 5936 of file Index.h.

◆ CXIdxClientEntity

typedef void* CXIdxClientEntity

The client's data object that is associated with a semantic entity.

Definition at line 5930 of file Index.h.

◆ CXIdxClientFile

typedef void* CXIdxClientFile

The client's data object that is associated with a CXFile.

Definition at line 5925 of file Index.h.

◆ CXIndexAction

typedef void* CXIndexAction

An indexing action/session, to be applied to one or multiple translation units.

Definition at line 6357 of file Index.h.

Enumeration Type Documentation

◆ CXBinaryOperatorKind

Describes the kind of binary operators.

Enumerator
CXBinaryOperator_Invalid 

This value describes cursors which are not binary operators.

CXBinaryOperator_PtrMemD 

C++ Pointer - to - member operator.

CXBinaryOperator_PtrMemI 

C++ Pointer - to - member operator.

CXBinaryOperator_Mul 

Multiplication operator.

CXBinaryOperator_Div 

Division operator.

CXBinaryOperator_Rem 

Remainder operator.

CXBinaryOperator_Add 

Addition operator.

CXBinaryOperator_Sub 

Subtraction operator.

CXBinaryOperator_Shl 

Bitwise shift left operator.

CXBinaryOperator_Shr 

Bitwise shift right operator.

CXBinaryOperator_Cmp 

C++ three-way comparison (spaceship) operator.

CXBinaryOperator_LT 

Less than operator.

CXBinaryOperator_GT 

Greater than operator.

CXBinaryOperator_LE 

Less or equal operator.

CXBinaryOperator_GE 

Greater or equal operator.

CXBinaryOperator_EQ 

Equal operator.

CXBinaryOperator_NE 

Not equal operator.

CXBinaryOperator_And 

Bitwise AND operator.

CXBinaryOperator_Xor 

Bitwise XOR operator.

CXBinaryOperator_Or 

Bitwise OR operator.

CXBinaryOperator_LAnd 

Logical AND operator.

CXBinaryOperator_LOr 

Logical OR operator.

CXBinaryOperator_Assign 

Assignment operator.

CXBinaryOperator_MulAssign 

Multiplication assignment operator.

CXBinaryOperator_DivAssign 

Division assignment operator.

CXBinaryOperator_RemAssign 

Remainder assignment operator.

CXBinaryOperator_AddAssign 

Addition assignment operator.

CXBinaryOperator_SubAssign 

Subtraction assignment operator.

CXBinaryOperator_ShlAssign 

Bitwise shift left assignment operator.

CXBinaryOperator_ShrAssign 

Bitwise shift right assignment operator.

CXBinaryOperator_AndAssign 

Bitwise AND assignment operator.

CXBinaryOperator_XorAssign 

Bitwise XOR assignment operator.

CXBinaryOperator_OrAssign 

Bitwise OR assignment operator.

CXBinaryOperator_Comma 

Comma operator.

Definition at line 6537 of file Index.h.

◆ CXIdxAttrKind

Enumerator
CXIdxAttr_Unexposed 
CXIdxAttr_IBAction 
CXIdxAttr_IBOutlet 
CXIdxAttr_IBOutletCollection 

Definition at line 6062 of file Index.h.

◆ CXIdxDeclInfoFlags

Enumerator
CXIdxDeclFlag_Skipped 

Definition at line 6097 of file Index.h.

◆ CXIdxEntityCXXTemplateKind

Extra C++ template information for an entity.

This can apply to: CXIdxEntity_Function CXIdxEntity_CXXClass CXIdxEntity_CXXStaticMethod CXIdxEntity_CXXInstanceMethod CXIdxEntity_CXXConstructor CXIdxEntity_CXXConversionFunction CXIdxEntity_CXXTypeAlias

Enumerator
CXIdxEntity_NonTemplate 
CXIdxEntity_Template 
CXIdxEntity_TemplatePartialSpecialization 
CXIdxEntity_TemplateSpecialization 

Definition at line 6055 of file Index.h.

◆ CXIdxEntityKind

Enumerator
CXIdxEntity_Unexposed 
CXIdxEntity_Typedef 
CXIdxEntity_Function 
CXIdxEntity_Variable 
CXIdxEntity_Field 
CXIdxEntity_EnumConstant 
CXIdxEntity_ObjCClass 
CXIdxEntity_ObjCProtocol 
CXIdxEntity_ObjCCategory 
CXIdxEntity_ObjCInstanceMethod 
CXIdxEntity_ObjCClassMethod 
CXIdxEntity_ObjCProperty 
CXIdxEntity_ObjCIvar 
CXIdxEntity_Enum 
CXIdxEntity_Struct 
CXIdxEntity_Union 
CXIdxEntity_CXXClass 
CXIdxEntity_CXXNamespace 
CXIdxEntity_CXXNamespaceAlias 
CXIdxEntity_CXXStaticVariable 
CXIdxEntity_CXXStaticMethod 
CXIdxEntity_CXXInstanceMethod 
CXIdxEntity_CXXConstructor 
CXIdxEntity_CXXDestructor 
CXIdxEntity_CXXConversionFunction 
CXIdxEntity_CXXTypeAlias 
CXIdxEntity_CXXInterface 
CXIdxEntity_CXXConcept 

Definition at line 6001 of file Index.h.

◆ CXIdxEntityLanguage

Enumerator
CXIdxEntityLang_None 
CXIdxEntityLang_C 
CXIdxEntityLang_ObjC 
CXIdxEntityLang_CXX 
CXIdxEntityLang_Swift 

Definition at line 6037 of file Index.h.

◆ CXIdxEntityRefKind

Data for IndexerCallbacks::indexEntityReference.

This may be deprecated in a future version as this duplicates the CXSymbolRole_Implicit bit in CXSymbolRole.

Enumerator
CXIdxEntityRef_Direct 

The entity is referenced directly in user's code.

CXIdxEntityRef_Implicit 

An implicit reference, e.g.

a reference of an Objective-C method via the dot syntax.

Definition at line 6185 of file Index.h.

◆ CXIdxObjCContainerKind

Enumerator
CXIdxObjCContainer_ForwardRef 
CXIdxObjCContainer_Interface 
CXIdxObjCContainer_Implementation 

Definition at line 6125 of file Index.h.

◆ CXIndexOptFlags

Enumerator
CXIndexOpt_None 

Used to indicate that no special indexing options are needed.

CXIndexOpt_SuppressRedundantRefs 

Used to indicate that IndexerCallbacks::indexEntityReference should be invoked for only one reference of an entity per source file that does not also include a declaration/definition of the entity.

CXIndexOpt_IndexFunctionLocalSymbols 

Function-local symbols should be indexed.

If this is not set function-local symbols will be ignored.

CXIndexOpt_IndexImplicitTemplateInstantiations 

Implicit function/class template instantiations should be indexed.

If this is not set, implicit instantiations will be ignored.

CXIndexOpt_SuppressWarnings 

Suppress all compiler warnings when parsing for indexing.

CXIndexOpt_SkipParsedBodiesInSession 

Skip a function/method body that was already parsed during an indexing session associated with a CXIndexAction object.

Bodies in system headers are always skipped.

Definition at line 6375 of file Index.h.

◆ CXResult

enum CXResult
Enumerator
CXResult_Success 

Function returned successfully.

CXResult_Invalid 

One of the parameters was invalid for the function.

CXResult_VisitBreak 

The function was terminated by a callback (e.g.

it returned CXVisit_Break)

Definition at line 5858 of file Index.h.

◆ CXSymbolRole

Roles that are attributed to symbol occurrences.

Internal: this currently mirrors low 9 bits of clang::index::SymbolRole with higher bits zeroed. These high bits may be exposed in the future.

Enumerator
CXSymbolRole_None 
CXSymbolRole_Declaration 
CXSymbolRole_Definition 
CXSymbolRole_Reference 
CXSymbolRole_Read 
CXSymbolRole_Write 
CXSymbolRole_Call 
CXSymbolRole_Dynamic 
CXSymbolRole_AddressOf 
CXSymbolRole_Implicit 

Definition at line 6203 of file Index.h.

◆ CXUnaryOperatorKind

Describes the kind of unary operators.

Enumerator
CXUnaryOperator_Invalid 

This value describes cursors which are not unary operators.

CXUnaryOperator_PostInc 

Postfix increment operator.

CXUnaryOperator_PostDec 

Postfix decrement operator.

CXUnaryOperator_PreInc 

Prefix increment operator.

CXUnaryOperator_PreDec 

Prefix decrement operator.

CXUnaryOperator_AddrOf 

Address of operator.

CXUnaryOperator_Deref 

Dereference operator.

CXUnaryOperator_Plus 

Plus operator.

CXUnaryOperator_Minus 

Minus operator.

CXUnaryOperator_Not 

Not operator.

CXUnaryOperator_LNot 

LNot operator.

CXUnaryOperator_Real 

"__real expr" operator.

CXUnaryOperator_Imag 

"__imag expr" operator.

CXUnaryOperator_Extension 

extension marker operator.

CXUnaryOperator_Coawait 

C++ co_await operator.

Definition at line 6625 of file Index.h.

◆ CXVisitorResult

Enumerator
CXVisit_Break 
CXVisit_Continue 

Definition at line 5851 of file Index.h.

Function Documentation

◆ clang_findIncludesInFile()

CINDEX_LINKAGE CXResult clang_findIncludesInFile ( CXTranslationUnit  TU,
CXFile  file,
CXCursorAndRangeVisitor  visitor 
)

Find #import/#include directives in a specific file.

Parameters
TUtranslation unit containing the file to query.
fileto search for #import/#include directives.
visitorcallback that will receive pairs of CXCursor/CXSourceRange for each directive found.
Returns
one of the CXResult enumerators.

◆ clang_findIncludesInFileWithBlock()

CINDEX_LINKAGE CXResult clang_findIncludesInFileWithBlock ( CXTranslationUnit  ,
CXFile  ,
CXCursorAndRangeVisitorBlock   
)

◆ clang_findReferencesInFile()

CINDEX_LINKAGE CXResult clang_findReferencesInFile ( CXCursor  cursor,
CXFile  file,
CXCursorAndRangeVisitor  visitor 
)

Find references of a declaration in a specific file.

Parameters
cursorpointing to a declaration or a reference of one.
fileto search for references.
visitorcallback that will receive pairs of CXCursor/CXSourceRange for each reference found. The CXSourceRange will point inside the file; if the reference is inside a macro (and not a macro argument) the CXSourceRange will be invalid.
Returns
one of the CXResult enumerators.

◆ clang_findReferencesInFileWithBlock()

CINDEX_LINKAGE CXResult clang_findReferencesInFileWithBlock ( CXCursor  ,
CXFile  ,
CXCursorAndRangeVisitorBlock   
)

◆ clang_getBinaryOperatorKindSpelling()

CINDEX_LINKAGE CXString clang_getBinaryOperatorKindSpelling ( enum CXBinaryOperatorKind  kind)

Retrieve the spelling of a given CXBinaryOperatorKind.

◆ clang_getCursorBinaryOperatorKind()

CINDEX_LINKAGE enum CXBinaryOperatorKind clang_getCursorBinaryOperatorKind ( CXCursor  cursor)

Retrieve the binary operator kind of this cursor.

If this cursor is not a binary operator then returns Invalid.

◆ clang_getCursorUnaryOperatorKind()

CINDEX_LINKAGE enum CXUnaryOperatorKind clang_getCursorUnaryOperatorKind ( CXCursor  cursor)

Retrieve the unary operator kind of this cursor.

If this cursor is not a unary operator then returns Invalid.

◆ clang_getUnaryOperatorKindSpelling()

CINDEX_LINKAGE CXString clang_getUnaryOperatorKindSpelling ( enum CXUnaryOperatorKind  kind)

Retrieve the spelling of a given CXUnaryOperatorKind.

◆ clang_index_getClientContainer()

CINDEX_LINKAGE CXIdxClientContainer clang_index_getClientContainer ( const CXIdxContainerInfo )

For retrieving a custom CXIdxClientContainer attached to a container.

◆ clang_index_getClientEntity()

CINDEX_LINKAGE CXIdxClientEntity clang_index_getClientEntity ( const CXIdxEntityInfo )

For retrieving a custom CXIdxClientEntity attached to an entity.

◆ clang_index_getCXXClassDeclInfo()

CINDEX_LINKAGE const CXIdxCXXClassDeclInfo * clang_index_getCXXClassDeclInfo ( const CXIdxDeclInfo )

◆ clang_index_getIBOutletCollectionAttrInfo()

CINDEX_LINKAGE const CXIdxIBOutletCollectionAttrInfo * clang_index_getIBOutletCollectionAttrInfo ( const CXIdxAttrInfo )

◆ clang_index_getObjCCategoryDeclInfo()

CINDEX_LINKAGE const CXIdxObjCCategoryDeclInfo * clang_index_getObjCCategoryDeclInfo ( const CXIdxDeclInfo )

◆ clang_index_getObjCContainerDeclInfo()

CINDEX_LINKAGE const CXIdxObjCContainerDeclInfo * clang_index_getObjCContainerDeclInfo ( const CXIdxDeclInfo )

◆ clang_index_getObjCInterfaceDeclInfo()

CINDEX_LINKAGE const CXIdxObjCInterfaceDeclInfo * clang_index_getObjCInterfaceDeclInfo ( const CXIdxDeclInfo )

◆ clang_index_getObjCPropertyDeclInfo()

CINDEX_LINKAGE const CXIdxObjCPropertyDeclInfo * clang_index_getObjCPropertyDeclInfo ( const CXIdxDeclInfo )

◆ clang_index_getObjCProtocolRefListInfo()

CINDEX_LINKAGE const CXIdxObjCProtocolRefListInfo * clang_index_getObjCProtocolRefListInfo ( const CXIdxDeclInfo )

◆ clang_index_isEntityObjCContainerKind()

CINDEX_LINKAGE int clang_index_isEntityObjCContainerKind ( CXIdxEntityKind  )

◆ clang_index_setClientContainer()

CINDEX_LINKAGE void clang_index_setClientContainer ( const CXIdxContainerInfo ,
CXIdxClientContainer   
)

For setting a custom CXIdxClientContainer attached to a container.

◆ clang_index_setClientEntity()

CINDEX_LINKAGE void clang_index_setClientEntity ( const CXIdxEntityInfo ,
CXIdxClientEntity   
)

For setting a custom CXIdxClientEntity attached to an entity.

◆ clang_IndexAction_create()

CINDEX_LINKAGE CXIndexAction clang_IndexAction_create ( CXIndex  CIdx)

An indexing action/session, to be applied to one or multiple translation units.

Parameters
CIdxThe index object with which the index action will be associated.

◆ clang_IndexAction_dispose()

CINDEX_LINKAGE void clang_IndexAction_dispose ( CXIndexAction  )

Destroy the given index action.

The index action must not be destroyed until all of the translation units created within that index action have been destroyed.

◆ clang_indexLoc_getCXSourceLocation()

CINDEX_LINKAGE CXSourceLocation clang_indexLoc_getCXSourceLocation ( CXIdxLoc  loc)

Retrieve the CXSourceLocation represented by the given CXIdxLoc.

◆ clang_indexLoc_getFileLocation()

CINDEX_LINKAGE void clang_indexLoc_getFileLocation ( CXIdxLoc  loc,
CXIdxClientFile indexFile,
CXFile file,
unsigned line,
unsigned column,
unsigned offset 
)

Retrieve the CXIdxFile, file, line, column, and offset represented by the given CXIdxLoc.

If the location refers into a macro expansion, retrieves the location of the macro expansion and if it refers into a macro argument retrieves the location of the argument.

◆ clang_indexSourceFile()

CINDEX_LINKAGE int clang_indexSourceFile ( CXIndexAction  ,
CXClientData  client_data,
IndexerCallbacks index_callbacks,
unsigned  index_callbacks_size,
unsigned  index_options,
const char *  source_filename,
const char *const *  command_line_args,
int  num_command_line_args,
struct CXUnsavedFile unsaved_files,
unsigned  num_unsaved_files,
CXTranslationUnit out_TU,
unsigned  TU_options 
)

Index the given source file and the translation unit corresponding to that file via callbacks implemented through IndexerCallbacks.

Parameters
client_datapointer data supplied by the client, which will be passed to the invoked callbacks.
index_callbacksPointer to indexing callbacks that the client implements.
index_callbacks_sizeSize of IndexerCallbacks structure that gets passed in index_callbacks.
index_optionsA bitmask of options that affects how indexing is performed. This should be a bitwise OR of the CXIndexOpt_XXX flags.
[out]out_TUpointer to store a CXTranslationUnit that can be reused after indexing is finished. Set to NULL if you do not require it.
Returns
0 on success or if there were errors from which the compiler could recover. If there is a failure from which there is no recovery, returns a non-zero CXErrorCode.

The rest of the parameters are the same as clang_parseTranslationUnit.

◆ clang_indexSourceFileFullArgv()

CINDEX_LINKAGE int clang_indexSourceFileFullArgv ( CXIndexAction  ,
CXClientData  client_data,
IndexerCallbacks index_callbacks,
unsigned  index_callbacks_size,
unsigned  index_options,
const char *  source_filename,
const char *const *  command_line_args,
int  num_command_line_args,
struct CXUnsavedFile unsaved_files,
unsigned  num_unsaved_files,
CXTranslationUnit out_TU,
unsigned  TU_options 
)

Same as clang_indexSourceFile but requires a full command line for command_line_args including argv[0].

This is useful if the standard library paths are relative to the binary.

◆ clang_indexTranslationUnit()

CINDEX_LINKAGE int clang_indexTranslationUnit ( CXIndexAction  ,
CXClientData  client_data,
IndexerCallbacks index_callbacks,
unsigned  index_callbacks_size,
unsigned  index_options,
CXTranslationUnit   
)

Index the given translation unit via callbacks implemented through IndexerCallbacks.

The order of callback invocations is not guaranteed to be the same as when indexing a source file. The high level order will be:

-Preprocessor callbacks invocations -Declaration/reference callbacks invocations -Diagnostic callback invocations

The parameters are the same as clang_indexSourceFile.

Returns
If there is a failure from which there is no recovery, returns non-zero, otherwise returns 0.

◆ clang_Type_visitFields()

CINDEX_LINKAGE unsigned clang_Type_visitFields ( CXType  T,
CXFieldVisitor  visitor,
CXClientData  client_data 
)

Visit the fields of a particular type.

This function visits all the direct fields of the given cursor, invoking the given visitor function with the cursors of each visited field. The traversal may be ended prematurely, if the visitor returns CXFieldVisit_Break.

Parameters
Tthe record type whose field may be visited.
visitorthe visitor function that will be invoked for each field of T.
client_datapointer data supplied by the client, which will be passed to the visitor each time it is invoked.
Returns
a non-zero value if the traversal was terminated prematurely by the visitor returning CXFieldVisit_Break.