enum CXChildVisitResult parentedDeclAndRefListBuilder(CXCursor cursor, CXCursor parent, CXClientData clientData) { ParentedCursorListPair* declsAndRefs = (ParentedCursorListPair*) clientData; if (clang_isDeclaration(clang_getCursorKind(cursor))) { ParentedCursor newEntry = { parent, cursor }; ParentedCursorList* decls = &declsAndRefs->decls; LIST_APPEND(ParentedCursor, decls, newEntry); } if (clang_isReference(clang_getCursorKind(cursor))) { ParentedCursor newEntry = { parent, cursor }; ParentedCursorList* refs = &declsAndRefs->refs; LIST_APPEND(ParentedCursor, refs, newEntry); } return CXChildVisit_Recurse; }
enum CXChildVisitResult referenceListBuilder(CXCursor cursor, CXCursor parent, CXClientData clientData) { if (clang_isReference(clang_getCursorKind(cursor))) { CursorList* childList = (CursorList*) clientData; LIST_APPEND(CXCursor, childList, cursor); } return CXChildVisit_Recurse; }
enum CXChildVisitResult parentedReferenceListBuilder(CXCursor cursor, CXCursor parent, CXClientData clientData) { ParentedCursorList* referenceList = (ParentedCursorList*) clientData; if (clang_isReference(clang_getCursorKind(cursor))) { ParentedCursor newEntry = { parent, cursor }; LIST_APPEND(ParentedCursor, referenceList, newEntry); } return CXChildVisit_Recurse; }
std::string libclang_vim::stringize_cursor_kind_type(CXCursorKind const& kind) { if (clang_isAttribute(kind)) return "Attribute"; if (clang_isDeclaration(kind)) return "Declaration"; if (clang_isExpression(kind)) return "Expression"; if (clang_isPreprocessing(kind)) return "Preprocessing"; if (clang_isReference(kind)) return "Reference"; if (clang_isStatement(kind)) return "Statement"; if (clang_isTranslationUnit(kind)) return "TranslationUnit"; if (clang_isUnexposed(kind)) return "Unexposed"; if (clang_isInvalid(kind)) return ""; return "Unknown"; }
bool CursorIsReference( CXCursor cursor ) { return clang_isReference( clang_getCursorKind( cursor ) ); }
bool cursor::isReference() const { return clang_isReference(kind()); }