• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 133
  • Last Modified:

Advanced searching with grep

There are huge source code with hundred files and hundred of thousands line of code and I have to find main function in this source code.

grep "main" ./*.c -RIl

Open in new window

Obviously this approach does not satisfy, because of huge output.

in source code, functions may be declared in this style
int
main(int argc, char *argv[])
{
}

Open in new window


Also, number of such style is unknown.
So I'm asking how to find function not text. is there any searcher programs which is able to search C functions?
Maybe you will recommend some regular expression?
0
Nusrat Nuriyev
Asked:
Nusrat Nuriyev
1 Solution
 
jmcgOwnerCommented:
The tool you're looking for is called ctags.
0
 
Nusrat NuriyevAuthor Commented:
brilliant
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now