Functions within file context


I am new to clang. I want to write a program to print all the function in a C file. I am having a problem, its also printing some functions which are included in header files. But i only want to print
functions which are defined in a given file. Is there any way to find this ?


Try SourceManager::isFromMainFile().