<div dir="ltr">Hello<div><br></div><div style>When I'm looking through cursors using 'clang_visitChildren', how do I check whether that cursor comes from an included file.</div><div style><br></div><div style>I have tried:</div>
<div style>CXFile cxf;</div><div style>clang_getSpellingLocation(clang_getRangeStart(clang_getCursorExtent(cursor), &cxf, NULL, NULL, NULL);</div><div style><br></div><div style>But clang_getCString(clang_getFileName(cxf)) will always return the name of the main file.</div>
<div style><br></div><div style>I have also tried:</div><div style>getTranslationUnitSpelling(clang_Cursor_getTranslationUnit(cursor))</div><div style><br></div><div style>and the same applies here.</div><div style><br></div>
<div style>I would like to be able to distinguish between cursors that are present in the original file, and those from included files.</div><div style><br></div><div style>Thanks, Peter</div></div>